Implementing the custom trigger
- Navigate to Salesforce Setup.
- Under the Objects and Fields section, click Object Manager.
- Choose the parent process object's child object. For example, if the process object is Opportunity and the drilled-down criteria are on the opportunity product, select Opportunity Product in the Object Manager.
- Click Triggers.
- Create New to create a new trigger.
- Delete the pre-existing code.
- Copy the code below, paste it into the new trigger, and replace the text in the square brackets with the child and parent objects; then click Save.
[NameOfTrigger (can be named anything)]>[ChildObject_API_Name](after insert, after update, before delete){ Set<Id parentObjectIds = new Set<Id (); [ChildObject_API_Name] childObjects = Trigger.isDelete ? Trigger.old : Trigger.new; [ChildObject_API_Name] childObject : childObjects){ [ParentObject_Lookup_Field]); } FSTR.ForceReevaluateSrvc.forceReevaluatePreFuture(parentObjectIds); }