Salesforce Platform Developer I (legacy) — Question 81
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?
Answer options
- 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.
Correct answer: D
Explanation
The correct answer is D because in Salesforce, a transaction can complete successfully as long as it does not exceed the governor limits, which includes the stack depth. Since the Account trigger reached a stack depth of 16, it does not affect the outcome of the transaction if the Contact trigger's stack depth is less than 16, allowing all changes to be committed.