Certified Platform Developer II Exam QuestionsBrowse all questions from this exam

Certified Platform Developer II Exam - Question 21


An environment has two Apex Triggers: an after-update trigger on Account and an after-update trigger on Contact. The Account after-update trigger fires whenever an Account's address is updated, and it updates every associated Contact with that address. The Contact after-update trigger fires on every edit, and it updates every Campaign Member record related to the Contact with the Contact's state.

Consider the following: A mass update of 200 Account records' addresses, where each Account has 50 Contacts. Each Contact has 1 Campaign Member. This means there are 10,000 Contact records across the Accounts and 10,000 Campaign Member records across the contacts.

What will happen when the mass update occurs?

Show Answer
Correct Answer: AB

The mass update will fail since both triggers operate within the same transaction context, leading to a total of 20,200 records being processed by DML statements, which exceeds the Salesforce governor limit of 10,000 DML statements per transaction.

Discussion

9 comments
Sign in to comment
nibbioOption: A
Nov 29, 2021

The mass update will fail since the triggers fire in the same transaction. This will implies 20200 records updated by the DML statement where the limit is 10000

suddebOption: A
Mar 11, 2022

Mass update will fail bcoz If trigger starts working from another trigger, they are executed in same transaction. Please refer the StackExchange: https://salesforce.stackexchange.com/questions/308165/invoking-a-trigger-from-another-trigger-execution-context

ChiaSamOption: A
Jun 13, 2022

Answer is A as whole transaction will roll-back due to DML error so Account will also not inserted

agjklsjrhgjksfOption: D
May 19, 2022

D is correct, even though both triggers share the same limit, 200 Accounts can be updated because they does not exceed that limit.

OmShantiVegOption: B
Jul 8, 2022

Ans is B , the first trigger is bellow 10001 threshold

HemdeneOption: A
Jan 5, 2023

Mass update will fail with System.LimitException: Too many DML rows: 10001

Ike300Option: A
Apr 7, 2023

Each trigger run in it's own context and yet they all share same Transaction context and the governor limit of 10000 DML is for latter, the operation will fail

MetaLojiqTeeOption: A
Jul 28, 2023

Both triggers execute in the same context

AnjindalOption: A
May 21, 2024

Correct ans is A