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, etc. dlgEvent_OnOpenForm
On Action States Update (Form)

Use this code event to manage the action state for actions defined for the form.

A form has predefined actions:
  • new
  • query
  • accept
  • cancel
  • search
If you have actions defined, use this event to set their state (setActionActive/ TRUE|FALSE, setActionHidden/ TRUE|FALSE).

Each action's state is determined by the GUI front-end (mobile or desktop) and the relation settings (disable Add, disable Search, and so on). Any code entered for this event is called after the program updates the state of these actions.

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

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 allowed or 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 code before the dialog instruction for display (DISPLAY ARRAY) terminates. Dialog finalization code can be implemented in this event.

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 allowed or not allowed to execute. This event is triggered at startup of a dialog for input (INPUT ARRAY). It is called before the program gives control to the user.

dlgEvent_Before_EditDialog
After Edit Dialog

Use this code event to check whether a field value is correct, and to give control back to the dialog if the value is not as expected. This event is triggered before the dialog instruction for input (INPUT ARRAY) terminates.

dlgEvent_After_EditDialog
Before Search Dialog

Use this code event to enable/disable actions and fields, and to give the focus to a specific field. This event is called before the user gets control of the dialog to enter search criteria. It is called before the program gives control to the user.

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 and to validate all the required fields. This event is called after a user has entered search criteria.

dlgEvent_After_SearchDialog
Before Empty Dialog

Use this event to enable/disable actions and display a message to the user. This event is called if the form or relation UI Settings Open mode property is set to Empty - empty mode (without data).

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

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

dlgEvent_OnActionCancel
On Action Close

Use this event to define a close action (instead of the default) in a dialog (INPUT, INPUT ARRAY, CONSTRUCT, DISPLAY ARRAY, or PROMPT). This event is triggered if the user closes the graphical 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 (corresponds to the "display", "modify" and "empty" UI modes).

dlgEvent_OnActionQuery