Feedback

onBeforeDeleteAll

This event occurs before deleting a record on a form application.

This event occurs after clicking the Delete button on the multi-record form. The form will execute the onValidate and onValidateSuccess events, then it will execute the onBeforeDeleteAll event before starting the execution of the SQL commands to delete records in the database.

Note: This event is triggered only once, regardless of the amount of lines removed in one click on the Delete button.

 


As examples we can see in the example below, we consult a user privileges table before deleting the record, if it does not have such privilege, we send an error message.

sc_lookup(priv_del," select priv_del from tb_privileges where login = [var_login] ");

if({priv_del[0][0]} != 'YES'){

sc_error_message(" you do not have privileges to perform this operation ");

}