Deal of The Day! 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:

Gilma
15 days ago
I think the trigger not having sufficient code coverage could also be a possible cause.
upvoted 0 times
...
Wai
17 days ago
Whoa, looks like someone's been playing a game of 'Trigger Ping Pong' with their code. C is definitely the answer here. Maybe the developer should consider taking a break and playing some actual ping pong instead.
upvoted 0 times
Nguyet
1 days ago
Yeah, it seems like the trigger is stuck in a loop. D is a likely cause.
upvoted 0 times
...
...
Caprice
24 days ago
I believe the trigger should be refactored into a helper class to avoid this issue.
upvoted 0 times
...
Chantay
25 days ago
I agree with Kent, that could be the cause of the error message.
upvoted 0 times
...
Pilar
1 months 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
1 months ago
I think the trigger is getting executed multiple times.
upvoted 0 times
...
Marshall
1 months 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
Yong
23 days ago
It's important to handle trigger recursion properly.
upvoted 0 times
...
Rocco
24 days ago
Maybe the trigger needs to be optimized to avoid re-execution.
upvoted 0 times
...
Jeniffer
25 days ago
Yeah, that could be the cause of the error.
upvoted 0 times
...
Willodean
28 days ago
I think the trigger is getting executed multiple times.
upvoted 0 times
...
...

Save Cancel