Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam CRT-450 All Questions

View all questions & answers for the CRT-450 exam

Exam CRT-450 topic 1 question 246 discussion

Actual exam question from Salesforce's CRT-450
Question #: 246
Topic #: 1
[All CRT-450 Questions]

Given the following Anonymous Block:

What should a developer consider for an environment that has over 10,000 Case records?

  • A. The transaction will succeed and changes will be committed.
  • B. The transaction will fail due to exceeding the governor limit.
  • C. The try/catch block will handle any DML exceptions thrown.
  • D. The try/catch block will handle exceptions thrown by governor limits.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
ApexMike
Highly Voted 2 years, 1 month ago
Selected Answer: B
Total number of records processed as a result of DML statements is 10k so if your list has over 10k records, database.update will fail.
upvoted 8 times
Dean5555
2 years, 1 month ago
This Question even nudges you to think about some 10k limit And try/catch shouldn't be used with DML exceptions https://www.crmscience.com/single-post/2020/05/20/how-salesforce-developers-handle-errors-with-try-catch-rollback-best-practices
upvoted 2 times
...
...
noox
Highly Voted 2 years, 10 months ago
Selected Answer: A
SOQL can retrieve 50.000 records. The org has only 10.000 records. The records are placed inside a list. Then the entire list is updated. So DML count is 1/150.
upvoted 6 times
noox
2 years, 10 months ago
Hum, it might be B, you can hit the heapSize limit with 10.000+ records in a list...
upvoted 3 times
...
Prince2010
2 years ago
The right answer is B
upvoted 4 times
...
...
SanjeevOnForce
Most Recent 1 year ago
Answer is B System.LimitException: Too many DML rows: 10001
upvoted 1 times
...
irina_735
1 year, 2 months ago
Selected Answer: B
When you hit a Governor Limit Exception, it terminates the entire transaction. Your application will terminate with an unhandleable exception
upvoted 2 times
...
vancika
1 year, 7 months ago
Selected Answer: C
I would go with the C: System.LimitException: Too many DML rows: 10001 is DmlException that is thrown by the Database.update statement! In a try-catch block the exception is handled (DmlException extends Exception)
upvoted 1 times
BrucePark
1 year, 3 months ago
You will see when you test it. Try catch won't catch the exception.
upvoted 4 times
...
...
DonAldos
1 year, 7 months ago
Selected Answer: B
In this example, the code updates 50,000 Case records, which exceeds the limit of 10,000 records per DML statement. Therefore, the transaction will fail due to exceeding the governor limit, and an exception will be thrown.
upvoted 2 times
...
freeP
1 year, 8 months ago
The org has over 10000 records as per the question hence answer is B , tried and tested
upvoted 2 times
...
smoota
1 year, 10 months ago
Selected Answer: B
Note that the update statement in in the For loop, and will fail after 150 DML statements
upvoted 2 times
vancika
1 year, 7 months ago
There's no such statement inside For loop!
upvoted 3 times
...
...
ElAprendiz
2 years ago
Selected Answer: B
has over 10,000 records == +10,000 records When you run it in Salesforce you will get: System.LimitException: Too many DML rows: 10001
upvoted 6 times
...
Rajiv1406
2 years, 2 months ago
Selected Answer: B
I have Executed This in my org and it is throwing LimitException
upvoted 5 times
Rajiv1406
2 years, 2 months ago
And the exception is thrown because case record is more than 10000.
upvoted 4 times
...
...
Asmodahlia
2 years, 4 months ago
Selected Answer: A
I agree with noox here. To elaborate on his point: It isn't B because no governor limits are being exceeded. It isn't C because we are utilizing Database.update with allOrNone set to false, meaning any updates that potentially fail will not result in an overall failure. It isn't D because Limit Exceptions cannot be caught.
upvoted 1 times
...
liadc
2 years, 6 months ago
I think the answer is B - the DML error will be thrown due to OVER 10,000 records. right?
upvoted 2 times
...
JCTheGenius
3 years, 2 months ago
No I think A is correct: Total number of records retrieved by SOQL queries 50,000
upvoted 3 times
...
Pally88
3 years, 4 months ago
Ans. is B
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...