Salesforce Platform Developer I (legacy) — Question 217
An Account trigger updates all related Contacts and Cases each time an Account is saved using the following two DML statements: update allContacts; update allCases;
What is the result if the Case update exceeds the governor limit for maximum number of DML records?
Answer options
- A. The Account save fails and no Contacts or Cases are updated.
- B. The Account save succeeds and no Contacts or Cases are updated.
- C. The Account save succeeds, Contacts are updated, but Cases are not.
- D. The Account save is retried using a smaller trigger batch size.
Correct answer: A
Explanation
If the update to Cases exceeds the governor limit for DML records, the entire transaction fails, which includes the save of the Account and updates to related Contacts and Cases. Therefore, option A is correct, while options B, C, and D are incorrect as they suggest that some updates would succeed when in fact, they do not.