ON ACTION block

The ON ACTION action-name block defines an action handler with a set of instructions to be executed when an action is invoked.
MENU "Customer"
   ON ACTION append
      CALL cust_append()
      CALL setup_dialog()
   ON ACTION modify
      CALL cust_modify()
      CALL setup_dialog()
   ON ACTION delete
      CALL cust_delete()
      CALL setup_dialog()
   ON ACTION quit
      EXIT MENU
END MENU

The decoration of the action can be defined in the form file with an explicit action view like TOOLBAR, TOPMENU or a form BUTTON. The action views and action handlers are bound by name. Default decoration for the action views will be taken from the action defaults, and applied according to the action name.

Example using a dialog-style menu:
MENU "Question"
     ATTRIBUTES (STYLE="dialog", COMMENT="Delete the row?")
   ON ACTION yes
      LET r = 'y'
   ON ACTION no
      LET r = 'n'
   ON ACTION cancel
      LET r = 'c'
END MENU
During the execution of a MENU dialog, actions can be enabled or disabled with the DIALOG.setActionActive() method. The default action views can be hidden or shown with the DIALOG.setActionHidden() method.
BEFORE MENU
   CALL DIALOG.setActionActive("query", FALSE)
   CALL DIALOG.setActionHidden("adduser", TRUE)