ON DELETE block

The ON DELETE trigger can be used to enable row deletion during a DISPLAY ARRAY dialog. If this block is defined, the dialog will automatically create the delete action. This action can be decorated, enabled and disabled as regular actions.

If the dialog defines an ON ACTION delete interaction block and the ON DELETE block is used, the compiler will stop with error -8408.

When the user fires the delete action, the dialog executes the user code of the ON DELETE block.

The dialog handles only the row deletion action and navigation, you can typically program a validation dialog box to let the user confirm the deletion. The current row in the program array is identified with arr_curr():
DISPLAY ARRAY arr TO sr.*
  ...
  ON DELETE
    IF fgl_winQuestion("Delete",
          "Do you want to delete this record?",
          "yes", "no|yes", "help", 0) == "no"
    THEN
       LET int_flag = TRUE
    END IF
    ...

After the user code is executed, the dialog gets the control back and processes the current row as follows:

The DISPLAY ARRAY dialog always resets INT_FLAG to FALSE and STATUS to zero before executing the user code of the ON DELETE block.

If needed, the ON DELETE handler can be configured with action attributes by added an ATTRIBUTES() clause, as with user-defined action handlers:
  ON DELETE ATTRIBUTES(TEXT=%"custlist.delete", IMAGE="listdel")