Event adelete

This event is called when a transaction has been triggered in a CRUD operation on a working copy if the transaction implies a deletion on an instance of the class in the database. When a deletion is in progress, it can be on the main class. When an update or a delete operation is done on the main class, it can be on a child class.

This event is called only for the persistent class or one of its child class that has been defined without the Delete check box selected in the Mapping tab. This means that the code associated with the deletion of the data in the database is not managed by the supervisor. The development partners must write their own code in this event. If the check box is selected, the supervisor calls a generated code to perform the deletion and the event is not called.

If an error occurs during this update, the development partner can use the ASETERROR(PRO,MES,NUM) method on the current class. A Rollback will automatically be triggered and the corresponding ADELETE_ROLLBACK event will be called.

Context

The class is filled, all the consistency controls for deletion have been performed, and the table declared in the class logic is opened. A transaction is in progress. The development partner can delete data in the database for the concerned class.

The following variables or properties are available in the context:

  • this refers to the current class instance that will be deleted. All properties can be found using the this.PROPERTY syntax.
  • CURPTH describes the child class path if the method is called on a child class. If the method is called on the main class, CURPTH is empty.
  • AEVENT is equal to ADELETE.