Additional Information in Method Hooks
In a number of cases the business logic differs depending on whether attributes are specified in the request or not. However, an empty value can indicate either the (optional) attribute value was unavailable in the request, or the attribute value was available but happened to be empty. For that reason, the developer who is coding the hook must be able to determine which input attributes are set.
In before, on and after execute method hooks, for each attribute implementation that is input for a method hook, a parameter is available to indicate whether the value is set. The parameter is true if the value is set (either from the request that was input for the method or through a default value or default value hook).
In on execute hooks, for each attribute implementation that is output for a hook, a parameter is available to indicate whether the value is set. By default the value is false, so it must be set for each attribute implementation attribute that is set in the hook.
An example of using an ‘isSet’ parameter in a before execute hook:
if not i.orderStatus.isSet then
io.cancel = true
endif
return(0) | OK
An example of using ‘isSet’ parameters in an on execute hook:
#pragma used dll oppmmmdll
return( ppmmmdll.my.function(i.orderNumber, i.orderNumber.isSet,
i.businessPartner, i.businessPartner.isSet,
io.orderStatus, io.orderStatus.isSet,
o.deliveryDate, o.deliveryDate.isSet) )
The ‘isSet’ parameters are unavailable for batch implementations.