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
Marc C.Marc C. 

After Update Trigger, Triggers itself

We would like to callout to another system each time a contact person is created. This 3rd party system returns a value which we want to write into the contact person record. If we callout "after update" then, when we write the returned value, we re-trigger our own trigger again -> infinite circle.



1) We callout "before update"

2) We use fields on the contact to check whether the callout should run

3) We use some global static variable to flag whether the callout should run


Neither of these options is very satisfying for various reasons.


Is there any way to know that a trigger was called directly from the UI and not from some Apex code (e.g. the code inside the trigger)?

Jeff MayJeff May

Here is a link to controlling recursive triggers -- based on the 'context' of a trigger -- which might get you a pointer to an acceptable solution.





A helper class with a  boolean can be sufficient. set the code in sucha way that call will run only when the value is false.