function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ChristineVWChristineVW 

What (if anything) Is Wrong With This Scenario - Two Triggers for Two Custom Objects

I have two custom objects, Development Requests and Jobs.  I need changes on a Job record to trigger changes to a picklist field on a related Development Request.  In turn, a limited number of field changes on a Development Request record should trigger changes to a picklist field on a related Case. 

Since Cases are chained to Development Requests, and Development Requests are chained to Jobs  -  through two separate lookup relationships - can I just create two "before update" triggers, one on the Job object, and one on the Development Request object?  Is there anything wrong with that?  It seems weird to have a field change caused by a trigger to instigate the firing of another "before update" trigger. 


werewolfwerewolf
Nope.  Nothing wrong with that at all.
werewolfwerewolf
...as long as your triggers don't trigger each other recursively.  But it sounds like you'll just be chaining one custom object to another custom object to Case, so that's fine.
BoxBox
If there is a recursive trigger issue you can just build a class containing static objects to store what IDs have already been processed by this trigger and use this as a process control.