Every model extends the PO class, which provides various hooks (methods) that one can override. They are
afterSave, beforeSave, afterDelete, and
beforeDelete. The syntax for these methods are:
protected boolean afterSave(boolean newRecord, boolean success) protected boolean afterDelete(boolean success) protected boolean beforeSave (boolean newRecord) protected boolean beforeDelete()
The main use of these methods is to perform additional tasks while a particular row of a table is being saved or deleted a particular row of a table. Let us say, we want to audit the activity, like create/update and delete, of the
C_Project table. To accomplish this, we shall override the
beforeDelete methods so that the ...