Form dialog events

Reference topic for the form dialog code events set.

Table 1. Form dialog events
Event Use when ... Function
On Open Form Use this code event to initialize the form, set up Toolbars, Menus, and so on. dlgEvent_OnOpenForm
On Action States Update (Form)

Use this code event to manage the action state for actions defined for the form, by setting an action as active (setActionActive/ TRUE|FALSE) or hidden (setActionHidden/ TRUE|FALSE).

The pre-defined actions for a form inlude:
  • new
  • query
  • accept
  • cancel
  • search

If you have other actions defined for the form, you can also set their state in this code event.

The state of an action is determined by the GUI front-end (mobile or desktop) and the relation setting (disable Add, disable Modify, disable Delete, disable Search).

Code entered for this event is called after the program updates the state of these actions.

dlgEvent_OnActionStatesChange
Before Browse Dialog

Use this code event to display messages to the user, initialize program variables, and set up the dialog instance by deactivating actions the user is not allowed to execute.

This event is triggered at the startup of a dialog for display (DISPLAY ARRAY), before the program gives control to the user.

dlgEvent_Before_BrowseDialog
After Browse Dialog

Use this code event to implement dialog finalization code.

This event is triggered before the dialog for display (DISPLAY ARRAY) terminates.

dlgEvent_After_BrowseDialog
Before Edit Dialog

Use this code event to display messages to the user, initialize program variables, and set up the dialog instance by deactivating actions the user is not allowed to execute.

This event is triggered at startup of a dialog for input (INPUT ARRAY), before the program gives control to the user.

dlgEvent_Before_EditDialog
After Edit Dialog

Use this code event to validate a field value, and give control back to the dialog if the value is not as expected.

This event is triggered before the dialog for input (INPUT ARRAY) terminates.

dlgEvent_After_EditDialog
Before Search Dialog

Use this code event to enable or disable actions and fields, or to give the focus to a specific field.

This event is called before the program gives control of the dialog (CONSTRUCT) to the user to enter search criteria.

dlgEvent_Before_SearchDialog
After Search Dialog

Use this event to check the content of the fields used in the search (CONSTRUCT). You can query the input buffers of the fields to get the values entered by the user, to validate their content or check for required fields.

This event is called after a user has entered search criteria.

dlgEvent_After_SearchDialog
Before Empty Dialog

Use this event to enable or disable actions, or to display a message to the user.

This event is called if the Open Mode property for a form (under UI Settings) or relation (under Destination UI Settings) is set to EMPTY (empty mode, without data.)

dlgEvent_Before_EmptyDialog
On Action Accept Use this event to overwrite the predefined action to accept the current interactive instruction. dlgEvent_OnActionAccept
On Action Cancel

Use this event to overwrite the predefined action to cancel the current interactive instruction.

dlgEvent_OnActionCancel
On Action Close

Use this event to overwrite the predefined action to close the dialog (INPUT, INPUT ARRAY, CONSTRUCT, DISPLAY ARRAY, or PROMPT).

This event is triggered if the user closes the window. Closing the window triggers a cancel key in the current interactive instruction (by default).

dlgEvent_OnActionClose
On Action Exit

Use this event to overwrite a predefined action to exit the current dialog.

dlgEvent_OnActionExit
On Action New

Use this event to overwrite a predefined action to insert a new row in the current dialog.

dlgEvent_OnActionNew
On Action Query

Use this event to overwrite a predefined action to query by example in DISPLAY ARRAY, INPUT ARRAY and MENU blocks (which correspond to the "DISPLAY", "MODIFY" and "EMPTY" UI modes.)

dlgEvent_OnActionQuery