O'Reilly logo

ADempiere 3.6 Cookbook by Ajit Kumar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Modifying hooks for a model

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 beforeSave and beforeDelete methods so that the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required