Before Save hook
Use this hook to perform additional actions before the current (new or existing) record is saved. Think of updating fields in other tables, validations that could not be done on field level, etc. The input argument for this hook is the mode.
This table shows the Mode values:
Mode |
Description |
---|---|
|
A new record is being inserted. |
|
An existing record is being updated. |
This hook is executed before the
before.save.object()
hook of the standard Data Access
Layer is executed. If the standard hook must be executed before the extension
hook is executed, you can force the standard hook to execute anytime you
prefer. This can be achieved by calling the
table.super()
function.
All field values of the current record of the table are available.
For more information, see
before.save.object()
of the standard Data Access Layer
in the
Infor ES Programmers Guide (Infor
Customer Portal KB2924522).
Example:
function extern long before.save.object(long mode)
{
table.super()
tcmcs004.cdf_lcdt = utc.num()
tcmcs004.cdf_user = logname$
return(0)
}