Userexits at Fields

When the user of your application edits records in masks, he usually changes field contents. DataView calls userexits at fields when the user enters or leaves fields with the write-cursor in mask edit state. Calling the various userexits at the field you can activate program functions that refer to the field entries. For instance you can request field contents, check for entries, calculate depending field entries or initiate program functions depending on field contents.

In DataView two triggers are available for calling userexits at fields. The pre_field-trigger is passed when the user enters the field with the cursor, while the post_field-trigger is passed when he leaves the field. The field triggers only work in Insert- and Update mode of Mask-Edit state, but not in Query- and View mode.

The field functionality you install via field userexits at the triggers of fields is not defined at the system object field in DataView. For you can apply a field in several masks, field userexits must always be invoked at the mask-field assignment. Though a field can be contained in several masks it is useful to assign its functionality to each corresponding mask (e.g. the post_field-trigger at the bill-of-material-field in the master list only results in a uniqueness check, while in the bill of material list a new relation can be generated).

pre_field-trigger
You call a field userexit at the pre_field-trigger if you want to initiate program functions on entering a field. For instance you can enter default values into the field that are later calculated as a result of other field entries.

post_field-trigger
You call a field userexit at the post_field-trigger if you want to initiate program functions on leaving a field. You can check field entries for correctness or consistency, or initiate actions depending on certain entries. The standard userexit dal_cch_chk_men, for instance, checks whether the field entry corresponds to an entry in the field selection menu on leaving a field. The user can only leave the field after specifying a correct entry.

hyper_field-trigger
You will use a userexit at the hyper_field trigger if you wanted trigger program functions after a single mouse click on the field. If a Hyper_Field userexit is installed and the field is not empty, the field content will be automatically is played as underlined as soon as the mouse pointer moves over it in NoSelect- and Select-state of a list or in Widget state of a form. The mouse cursor changes. A mouse click will trigger the function.

Usually you will open masks to display depending data. Thus, you lighten context menus or context button areas and care for a manageable number of selections or buttons at or in masks.

In order to identify hyperlink fields for the user, you can define colours for the field contents and the field background using the default variable VIDEOHYPERLINK.

Note! You cannot perform a mouse double click on hyperlink fields. As the mouse double click is a frequently used means for quick editing (dal_cch_sel_dtv at the Select_Action trigger), you should not use the hyperlink functionality for fields which have to be edited often. In this case you should offer the required functions in the context menu or in the context button area.