Salesforce Certified Platform Developer II — Question 9
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?
Answer options
- A. Remove the Apex Class from the Integration User's Profile.
- B. Use the Database method with allOrNone set to False.
- C. Use a Try/Catch block after the insert statement.
- D. Deactivate the Trigger before the Integration runs.
Correct answer: B
Explanation
The correct answer is B because using the Database method with allOrNone set to False allows the operation to proceed even if some records fail, thus preventing the integration from being affected by the errors generated by the trigger. Option A would restrict access to the Apex Class, which may not directly address the integration issue, while options C and D do not resolve the underlying problem of the integration receiving errors.