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

Exam Certified Platform Developer II All Questions

View all questions & answers for the Certified Platform Developer II exam

Exam Certified Platform Developer II topic 1 question 21 discussion

Actual exam question from Salesforce's Certified Platform Developer II
Question #: 21
Topic #: 1
[All Certified Platform Developer II Questions]

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?

  • 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.
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
Lespamtor
Highly Voted 3 years, 10 months ago
Correct answer B
upvoted 17 times
Soliton321
3 years, 10 months ago
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".
upvoted 5 times
...
...
amerbearat
Highly Voted 3 years, 2 months ago
Answer: B A Try/Catch block after the insert statement has no sense. It could be wrapping the insert.
upvoted 11 times
...
beardAnt
Most Recent 1 month, 1 week ago
Selected Answer: B
Using the Database methods with allOrNone set to False allows for partial success in DML operations. This means that if there are multiple records being inserted or updated and one of them fails (for example, due to validation rules), the successful records will still be processed
upvoted 1 times
...
aregas
5 months, 2 weeks ago
Selected Answer: B
B is the answer
upvoted 1 times
...
Anjindal
5 months, 2 weeks ago
Selected Answer: B
Correct answer B
upvoted 1 times
...
FriedConsole2000
9 months ago
Selected Answer: C
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.
upvoted 1 times
...
VVeguru
1 year, 3 months ago
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
upvoted 1 times
...
levian
2 years, 1 month ago
B is te answer
upvoted 3 times
...
suddeb
2 years, 8 months ago
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.
upvoted 2 times
...
yela
3 years, 2 months ago
i was wrong with my first response, i think B is better.
upvoted 3 times
...
yela
3 years, 2 months ago
yes, i confirm the correct answer is C
upvoted 2 times
...
singhkar
3 years, 5 months ago
The correct ans is C
upvoted 1 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 ...