After Save hook

Use this hook to perform additional actions after the current (new or existing) record is saved. Think of updating fields in other tables, 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 after.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 being executed 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 after.save.object(long mode) 
{
        table.super()
        with.old.object.values.do(get.old.values)
        if tcmcs004.cdf_city <> old.city then
                ret = txcomdll0001.log.city.change(
                                   old.city, tcmcs004.cdf_city)
                if ret < 0 then
                        dal.set.error.message(
                               "@Error during logging city change")
                        return(DALHOOKERROR)
                endif
        endif
        return(0)
}

For more information about after.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.