Before Destroy hook

Use this hook to perform additional actions before the current record is deleted. Think of updating fields in other tables, additional checks whether it can delete the record, etc.

This hook is executed before the before.destroy.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 before.destroy.object() 
{
        table.super()
        select  txcom001.* 
        from    txcom001
        where   txcom001.crou = :tcmcs004.crou
        as set with 1 rows
        selectdo
                dal.set.error.message(
                       "@Route still being used in Carrier Plan")
                return(DALHOOKERROR)
        endif
        return(0)
}

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