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
DAL_NEW A new record is inserted.
DAL_UPDATE An existing record is 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.

Example:

function extern long before.save.object(long mode) 
{
        table.super()
        tcmcs004.cdf_lcdt = utc.num()
        tcmcs004.cdf_user = logname$
        return(0)
}

For more information about before.save.object() of the standard Data Access Layer, see the Infor ES Programmers Guide (Infor Customer Portal KB2924522).

For more information about using the table.super() function within hooks, see Using table.super() in hooks.