nerdexam
Salesforce

PDII · Question #106

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…

The correct answer is C. Use a static variable to prevent the trigger from executing more than once. See the full explanation below for the reasoning.

Question

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?

Options

  • ADeactivate the trigger and move the logic into a Process or Flow
  • BDeactivate the workflow rule to prevent the field update from executing
  • CUse a static variable to prevent the trigger from executing more than once
  • DUse a global variable to prevent the trigger from executing more than once

How the community answered

(31 responses)
  • A
    16% (5)
  • B
    3% (1)
  • C
    74% (23)
  • D
    6% (2)

Community Discussion

No community discussion yet for this question.

Full PDII Practice