A developer created a new after insert trigger on the Lead object that creates Task records for each Lead.
After deploying to production, an existing outside integration that inserts Lead records in batches to Salesforce is occasionally reporting total batch failures being caused by the Task insert statement. This causes the integration process in the outside system to stop, requiring a manual restart.
Which change should the developer make to allow the integration to continue when some records in a batch cause failures due to the Task
insert statement, so that manual restarts are not needed?
Suggested Answer: A
Get Premium DEX-450 Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
21 comments · newest first
HE
Henriette
1 month ago
Exactly! D gives more control over the process.
KE
Kerry
2 months ago
True, but it might not handle the errors as cleanly as D.
SH
Sharen
2 months ago
But what about option A? It could allow partial success too.
HE
Henriette
2 months ago
I agree with Kerry. It prevents the whole batch from failing.
KE
Kerry
2 months ago
I think option D is the best. A try-catch block can handle errors gracefully.
SH
Sharen
2 months ago
This question is tricky. I feel like it’s testing our understanding of error handling.
NA
Natalie
2 months ago
Yeah, I wouldn't go with B. We need the trigger for other leads.
CL
Clorinda
3 months ago
Deactivating the trigger seems risky. What if it causes other issues?
AD
Adelle
3 months ago
True, but I feel like try-catch gives more control over the errors.
RE
Rebbeca
3 months ago
But what about option A? It could help with partial successes too.
AM
Amber
3 months ago
I agree, try-catch can handle errors without stopping everything.
GE
Georgeanna
3 months ago
This question is tricky! I think option D is the best choice.
CA
Carlota
4 months ago
Removing the Apex class seems extreme and unnecessary.
CL
Clement
4 months ago
Using allow one set to false can help too, but it's not the full solution.
KE
Kelvin
4 months ago
Surprised that this is causing batch failures! Didn't expect that.
SY
Sylvia
5 months ago
I disagree, deactivating the trigger might be a better approach.
AN
Annabelle
6 months ago
Option D is the best choice! Try-catch blocks are essential for error handling.
KR
Kristal
6 months ago
I feel like removing the Apex class from the integration user's profile doesn't really address the issue with the Task insert.
AL
Alverta
6 months ago
I practiced a similar question where using the Database method with allow one set to false helped avoid batch failures.
CA
Candida
6 months ago
I'm not entirely sure, but I think deactivating the trigger could be risky since it would stop all Task creation.
CE
Celestina
7 months ago
I remember something about using try-catch blocks to handle exceptions in Apex. That might help with the Task insert failures.