When the code execution, which two events occur as a result of the Apex transaction?

Refer to the following code snippet for an environment has more than 200 Accounts belonging to the Technology’ industry:

When the code execution, which two events occur as a result of the Apex transaction? Choose 2 answers
A . If executed in an asynchronous context, the apex transaction is likely to fall by exceeding the DML governor limit
B . The Apex transaction succeeds regardless of any uncaught exception and all processed accounts are updated.
C . The Apex transaction fails with the following message. "SObject row was retrieved via SOQL without querying the requested field Account.Is.Tech__c”.
D . If executed In a synchronous context, the apex transaction is likely to fall by exceeding the DHL governor limit.

Answer: C

Latest PDI Dumps Valid Version with 191 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
2 Comments
Inline Feedbacks
View all comments
Deepika Selvanambi
Deepika Selvanambi
1 year ago

for (account a:[select id,industry from account limit 150]){
if(a.industry==’Technology’){
a.Is_Tech__c=true;
}
update a;
}

The code is executed successfully .

B is the correct Answer.

C is incorrect .
A is incorrect.

D might be correct not sure what is DHL

Perfecto
Perfecto
2 years ago

The correct answer is B.

For sync and async apex we have the same limit of 150 DML statements per transaction, so there is no point where we call this code, so A and D is incorrect.

https://developer.salesforce.com/docs/atlas.en-us.236.0.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_apexgov.htm

C is Also incorrect, because we do not need to query Is_Tech__c frield to set the value. We only require a query is we want to read this field.