PERFORM specifies a trigger in the Process Module (PM) to execute when the cursor moves to the item (BEFORE option) or when the corresponding menu item is selected (default).
Within the performed trigger, the system field @MENU_ACTION can be set to control what happens after the trigger executes:
REDO causes the cursor to stay at the currently selected menu item after returning from the trigger.
END causes the menu operation to terminate after the trigger completes execution.
If the menu is operated at command level, this substatement is ignored. This substatement is also ignored if the menu is operated in a PM and the trigger specified in this substatement does not exist.
/[PERFORM trigger_name [/ALWAYS/ BEFORE]]...
trigger_name |
specifies the existing PM's trigger name. |
BEFORE |
performs a trigger as soon as the cursor is moved to the item. Examples of functions that the trigger could perform are displaying a prompt, a help message, a form, or even another menu. The performed trigger could also move the cursor to another item based on some condition by setting a value to the system field @NEXT_ITEM. |
/PERFORM DATA_ENTRY
This substatement shows that the PM trigger DATA_ENTRY should be executed when the corresponding item is selected. This PM trigger could display another menu, perform the appropriate data entry, etc.