Salesforce Certified Platform Developer II — Question 56

A developer has written an After Update trigger on Account. A workflow rule and field update cause the trigger to repeatedly update the Account records.
How should the developer handle the recursive trigger?

Answer options

Correct answer: C

Explanation

The correct answer is C because using a static variable allows the developer to track whether the trigger has already executed during the current transaction, preventing recursion. Options A and B would remove functionality instead of solving the issue, while option D is incorrect as a global variable does not provide the necessary control for this scenario.