A recursive transaction is initiated by a DML statement creating records for these two objects: 1. Accounts 2. Contacts The Account trigger hits a stack depth of 16. Which statement is true regarding the outcome of the transaction?
A.
The transaction fails and all the changes are rolled back.
B.
The transaction succeeds as long as the Contact trigger stack depth is less than 16.
C.
The transaction fails only if the Contact trigger stack depth is greater or equal to 16.
D.
The transaction succeeds and all changes are committed to the database.
D is correct.
The maximum trigger depth exceeded error in Salesforce occurs when a trigger recursively invokes triggers more than 16 times.
In this case its reach the 16 which is still in the limit.
Since is a recursion, it's just going to keep going indefinitely until its force to hit the max stack depth. . Unless explicitly specified in the question, So b and c wouldn't make sense, since u won't have control over the amount of times the recursion is going to run. By default dml transactions that fail will rollback unless specified otherwise by using allornone = false.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
DonAldos
Highly Voted 3 years agoSanjeevOnForce
Most Recent 1 year agojustarandomguy
2 years, 7 months agoillyaOsiyuk
2 years, 11 months ago