Download page Configuring the Execution of the RelatedLineItem Trigger.
Configuring the Execution of the RelatedLineItem Trigger
The out-of-the-box RelatedLineItem trigger, in it’s update block, allocates the net price of the service line item to all associated related line item records based on the Weightage Type and Weightage Amount fields. However, some customers may have their own allocation model and want to customize it based on their requirements. For such customers, the out-of-the-box RelatedLineItem trigger is redundant and can impact performance. CPQ allows you to control the execution of the RelatedLineItem trigger. You can use the global flag isTriggerInitiatedUpdate to conditionally skip the trigger logic, which allocates the net price of the service line item, and to avoid the unnecessary code execution and potentially improve performance in such cases.
The isTriggerInitiatedUpdate flag controls the “before and after update” block only. However, CPQ executes the “before and after insert” block regardless of the value of this flag. This flag remains set for the whole transaction until you unset the flag or until the transaction ends. Currently, CPQ respects this flag only in the RelatedLineItem trigger.
When the value of the flag is set to True, CPQ skips the execution of the RelatedLineItem trigger. CPQ does not use the out-of-the-box logic to allocate the net price of the service line item to all related line items on updating the related line items from the custom code.
When the value of the flag is set to False, CPQ executes of the RelatedLineItem trigger. CPQ uses the out-of-the-box logic to allocate the net price of the service line item to all related line items based on the Weightage Type and Weightage Amount on updating the related line items from the custom code.
The following is an example of custom code for reference: