Certified Platform Developer II Exam QuestionsBrowse all questions from this exam

Certified Platform Developer II Exam - Question 20


A developer created a new trigger that inserts a Task when a new Lead is created. After deploying to production, an outside integration is periodically reporting errors.

Which change should the developer make to ensure the integration is not affected with minimal impact to business logic?

Show Answer
Correct Answer: BC

To ensure the integration is not affected with minimal impact to business logic, the developer should use the Database method with allOrNone set to False. This approach allows partial success in bulk operations, meaning that if some records fail, the successful ones will still be processed, thus preventing the entire transaction from rolling back. This ensures that the integration does not encounter errors due to the failure of some operations, maintaining smoother workflow and data consistency.

Discussion

11 comments
Sign in to comment
LespamtorOption: B
Dec 28, 2020

Correct answer B

Soliton321
Jan 9, 2021

yes. You can surely suppress the error using try catch, but the insertion of other record within the same transaction will be canceled as well. Since try catch is "AllOrNone".

amerbearatOption: B
Aug 13, 2021

Answer: B A Try/Catch block after the insert statement has no sense. It could be wrapping the insert.

yelaOption: B
Aug 9, 2021

i was wrong with my first response, i think B is better.

levianOption: B
Sep 29, 2022

B is te answer

yelaOption: C
Aug 9, 2021

yes, i confirm the correct answer is C

suddebOption: B
Mar 11, 2022

Try Catch Block after the insert statement doesn't make sense at all. It should be around the insert statement. So to me correct answer is B.

singhkarOption: C
Jun 3, 2021

The correct ans is C

VVeguruOption: C
Jul 20, 2023

Didn't get proper explanation why try and catch need to be used after Insert. It also know about the issue but never resolve the problem

FriedConsole2000Option: C
Feb 8, 2024

All of these answers are bad. "C" is best because with "use the Database method with allOrNone set to False" would still produce an error to the integration.

AnjindalOption: B
May 21, 2024

Correct answer B

aregasOption: B
May 22, 2024

B is the answer