Cyber Monday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Exam CRT-450 Topic 5 Question 68 Discussion

Actual exam question for Salesforce's CRT-450 exam
Question #: 68
Topic #: 5
[All CRT-450 Questions]

A developer created a trigger on the Account object. While testing the trigger, the developer sees the error message 'Maximum trigger depth exceeded'.

What could be the possible causes?

Show Suggested Answer Hide Answer
Suggested Answer: C

The error message 'Maximum trigger depth exceeded' occurs when a trigger invokes itself recursively more than the allowed limit.

Option C: The trigger is getting executed multiple times.

Correct Answer.

This error indicates that the trigger is recursively calling itself.

This can happen if the trigger performs an update or insert operation that causes the same trigger to fire again, leading to an infinite loop.

Salesforce enforces a limit on the recursion depth to prevent stack overflows.

User permissions do not cause the 'Maximum trigger depth exceeded' error.

Option B: The trigger is too long and should be refactored into a helper class.

*Incorrect, but possible code improvement.

While refactoring code into helper classes is a good practice, it does not directly address the recursion issue causing the error.

Option D: The trigger does not have sufficient code coverage.

Incorrect.

Code coverage issues affect deployment but do not cause runtime errors like 'Maximum trigger depth exceeded'.

Conclusion:

The error is caused because the trigger is getting executed multiple times due to recursion, leading to exceeding the maximum trigger depth.


Triggers and Order of Execution

Preventing Recursive Triggers

Incorrect Options:

Option A: The developer does not have the correct user permission.

Incorrect.

Contribute your Thoughts:

Pilar
4 days ago
Hold up, doesn't this sound like a classic case of recursion gone wild? I bet the developer forgot to add some kind of exit condition in the trigger. Option C is the way to go.
upvoted 0 times
...
Kent
4 days ago
I think the trigger is getting executed multiple times.
upvoted 0 times
...
Marshall
5 days ago
Hmm, the 'Maximum trigger depth exceeded' error usually means the trigger is causing itself to be re-executed. I'd go with option C - the trigger is getting executed multiple times.
upvoted 0 times
...

Save Cancel