BEFORE DISPLAY block

BEFORE DISPLAY block in singular and parallel DISPLAY ARRAY dialogs

In a singular DISPLAY ARRAY instruction, or when used as parallel dialog, the BEFORE DISPLAY is only executed once when the dialog is started.

The BEFORE DISPLAY block is executed once at dialog startup, before the runtime system gives control to the user. This block can be used 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.

DISPLAY ARRAY p_items TO s_items.*
   BEFORE DISPLAY
       CALL DIALOG.setActionActive("clear_item_list", is_super_user())

BEFORE DISPLAY block DISPLAY ARRAY of procedural DIALOG

In a DISPLAY ARRAY sub-dialog of a procedural DIALOG instruction, the BEFORE DISPLAY block is executed when a DISPLAY ARRAY list gets the focus.

BEFORE DISPLAY is executed before the BEFORE ROW block.

In this example the BEFORE DISPLAY block enables an action and displays a message:

DISPLAY ARRAY p_items TO s_items.*
   BEFORE DISPLAY
       CALL DIALOG.setActionActive("print_list", TRUE)
       MESSAGE "You are now in the list of items"