Business Studies, asked by mthangabalaji4026, 1 year ago

A trigger is running multiple times during a single save event in an org. how can this be prevented?

Answers

Answered by writersparadise
1

The answer is Trigger.isExecute.

 

One of the major reasons why a trigger is running multiple times during a single save event is that the trigger execution statement is included along with a set of statements that must be performed repeatedly in a loop. To avoid such instances of multiple execution, the Trigger.isExecute command must be used.
Answered by Anonymous
2

Explanation:

\huge\underline{\underline{\mathfrak \red{Answer}}}  \\

To avoid these kind of situation we can use public class static variable.

  • In RecursiveTriggerHandler class, we have a static variable which is set to true by default.

  • Once this trigger fired the static variable value will set to false and trigger will not fire again.

Similar questions