CANCEL DELETE instruction

Deletion can be canceled, by using the CANCEL DELETE instruction in theBEFORE DELETE block. Using this instruction in a different place will generate a compilation error.

When the CANCEL DELETE instruction is executed, the current BEFOREDELETE block is terminated without any other trigger execution (no BEFOREROW or BEFORE FIELD is executed), and the program execution continues in the user event loop.

For example, you can prevent row deletion based on some condition:
BEFORE DELETE
   IF user_can_delete() == FALSE THEN
      ERROR "You are not allowed to delete rows."
      CANCEL DELETE
   END IF

The instructions that appear after CANCEL DELETE will be skipped.

You can also disable the delete action to prevent the user from performing a delete row action with:
CALL DIALOG.setActionActive("delete", FALSE)