Before Mappings hook

Use this hook to read additional data before the standard context message is built. This hook can use actual values of the selected Infor LN object.

As an alternative you can also read the data with a function mapped to an element in the field mapping. But in case you require multiple values of the same table, we recommend that you use this hook.

In this example, the Sales Office of the Sales Order is read. Then the tdsls400.cofc field can be used in the field mapping.

function extern long before.mapping.hook.com.infor.ln.businesscontext_tdsls400_1()
{
        select  tdsls400.cofc
        from    tdsls400
        where   tdsls400.orno = :tdsls400.orno
        as set with 1 rows
        selectdo
        endselect
        
        return(0)
}

Use the message.super() function in this case:

  • The standard context message contains a before.mapping.hook() and the values that are set by the standard hook are required in your logic.