CRT-450 Exam QuestionsBrowse all questions from this exam

CRT-450 Exam - Question 206


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

When the code executes, what happens as a result of the Apex transaction?

Show Answer
Correct Answer: AC

The provided code snippet is designed to update the 'Is_Tech__c' field of accounts where the 'Industry' field equals 'Technology'. Since the SOQL query is limited to 150 records, the number of DML statements (one per record) will not exceed the DML governor limit, which is 150 DML statements per transaction. Additionally, the code does not attempt to retrieve the 'Is_Tech__c' field value, only to update it, which is permissible without querying that field. Thus, the correct result is that the Apex transaction succeeds regardless of any uncaught exception and all processed accounts are updated.

Discussion

8 comments
Sign in to comment
wlthornOption: B
Mar 29, 2023

B is correct?

BruceParkOption: B
Jul 18, 2023

I also haven't tested it but B seems more correct

irina_735
Sep 14, 2023

None of the answers are correct. Two interesting things: 1) you CAN update fields without querying in SOQL, but you can`t get the values from them without querying. 2) This snippet makes another error: System.LimitException: Too many SOQL queries: 101

irina_735
Sep 14, 2023

There was a bloblem with trigger, correct answer is A

BruceParkOption: C
Jul 21, 2023

DML limit is 150 so B wouldn't be correct. C seems correct answer....?

irina_735Option: A
Sep 14, 2023

You can update fields without querying in SOQL (you can`t get the values from them without querying) So, A is correct

SanjeevOnForceOption: A
Nov 2, 2023

i think A is correct as the query has a limit of 150 and the DML Limit is also 150

JPV85Option: A
Dec 7, 2023

Answ. A

SS1121Option: A
Jun 20, 2024

A is correct