2 answers
Please check below post for same1) http://amitsalesforce.blogspot.in/2015/03/how-to-stop-recursive-trigger-in.htmlProblem :- 1) Many Developers face recursive trigger , or recursive update trigger. For example in 'after update' trigger, Developer is performing update operation and this lead to recursive call.2) You want to write a trigger that creates a new record ; however, that record may then cause another trigger to fire, which in turn causes another to fire, and so on. Solution :-you can create a class with a static Boolean variable with default value true. In the trigger, before executing your code keep a check that the variable is true or not. Once you check make the variable false.
Hi,We have multiple ways to avoid recursive triggers. They all depend on your use case, While one solution may work but will not work for others. Check the below links, It has multiple ways to avoid recursive trigger: https://newstechnologystuff.com/2020/05/28/avoid-recursive-trigger-in-salesforce/Many Developers face recursive trigger or recursive update trigger. For example in 'after update' trigger, the Developer is performing update operation, and this leads to the recursive call. Or if we have WF field update sometimes they also contribute to recursive triggers.