cch_get_rec

When entering a new record in a relation mask - refine- or aggregate mask - or in a type mask): Searches for an existing entry in the master table of the entity, which corresponds to the current entry in the master data field of the relation mask.

If a master record is found, DataView will automatically enter all subsequent master attributes visible in the relation or type mask.

If several master records are found, DataView will automatically enter all subsequent master attributes of the first record found.

If no record is found, a message will appear. The user can only leave the field after he either cancels the insert operation, enters nothing, or specifies a value which the userexit can find in the master table of the entity.


Usage as:

Post_Field Userexit at fields of relation masks.


Explanation:

Using this userexit you can simply prevent new records from being entered in relation or type masks if no master record exists for the child entity the relation is directed to. Thus you force the user to first create the master entries in a master list of the parent entity, before he creates a relation. Simultaneously you make sure that all master attributes are automatically displayed if the userexit allows a new entry in the relation mask. The user only has to add relation or type attributes.

Only use this userexit at fields in relation or type masks containing significant attributes of the child entity or type attributes. Usually this is the first field of a relation or type mask (e.g. a supplier's number in a relation list, which displays all suppliers of an item). DataView supports you by automatically defining the userexit cch_get_rec as Post_Field userexit at the first field (first master attribute of the child entity) of the refine or aggregate list if you create the standard list for the relation during model definition. At the same time DataView sets the field in the mask-field assignment

On the one hand this forces the user to specify the significant attribute for new entries, on the other hand this disallows any later changes.