| The Dialog class / Usage | |
Using the DIALOG keyword outside a dialog instruction block results in a compilation error. However, you can pass the object to a function that defines the dialog parameter with the ui.Dialog type.
INPUT BY NAME custid, custname, custaddr
BEFORE INPUT
CALL setupDialog(DIALOG)
...
ON ACTION check_address
...
CALL setupDialog(DIALOG)
...
END INPUT
FUNCTION setupDialog(d)
DEFINE d ui.Dialog
DEFINE isAdmin BOOLEAN
LET isAdmin = (global_params.user_group == "admin")
CALL d.setActionActive("delete", isAdmin)
CALL d.setActionActive("convert", isAmdin)
CALL d.setActionActive("check_address",
isAdmin AND rec.custaddr IS NOT NULL)
END FUNCTION