BEFORE DIALOG block
The
BEFORE DIALOG block is executed one time as the first trigger when the
DIALOG instruction starts, before the runtime system gives control to the user. You
can implement variable initialization and dialog configuration in this block.Note: Like all control
blocks of the procedural
DIALOG / END DIALOG instruction, the BEFORE
DIALOG block must appear after the sub-dialog definitions. For a detailed description, see
the procedural DIALOG instruction
syntax.In the next code example, the BEFORE DIALOG block performs some dialog setup and
gives the focus to a specific field:
DIALOG
DISPLAY ARRAY ...
...
END DISPLAY
INPUT BY NAME ...
...
END INPUT
...
BEFORE DIALOG
CALL DIALOG.setActionActive("save",FALSE)
CALL DIALOG.setFieldActive("cust_status", is_admin())
IF cust_is_new() THEN
NEXT FIELD cust_name
END IF
...
END DIALOG
A DIALOG instruction can include no more than
one BEFORE DIALOG control block.