You need to sign in to do that
Don't have an account?
Recursive Triggers
Hey Everyone,
I am having difficulty running some tests with triggers.
First trigger updates an Event object when an Opp has been updated.
The second trigger tries to update the Opp when the Event has been updated.
Just trying to keep information accurate on each object, however as you can imagine if I update from either trigger it runs the trigger for the other object and I get a recursive trigger execution.
Both are running 'after update'.
Is there a simple method or way to update each record without it having to trigger the other? Maybe it is as simple as checking if the values match before running an update?
Looking for some guidence on the workflow, or method to accomplish keeping two records up to date without having recursive triggers running.
I appreciate any help! :)
One possible way is to try an extrinsic locking method. The simplest way is to have a static Boolean isRunning value set on a public static class. When the opportunity is being updated, set that isRunning value to true (it should by default be false), then when the other trigger is about to run, verify the value of that static boolean.
Nifty idea, I will give it a try, thanks!
Worked like a charm! I appreciate it! :)