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 414 discussion

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

A developer created an Apex class that updates an Account based on input from a Lightning web component that is used to register an Account. The update to the Account should only be made if it has not already been registered.



What should the developer do to ensure that users do not overwrite each other's updates to the same Account if they make updates at the same time?

  • A. Use FOR UPDATE in the SOQL query.
  • B. Include LastModifiedDate in the query to make sure it wasn't recently updated.
  • C. Use upsert instead of update.
  • D. Add a try/catch block around the update.
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
beardAnt
2 weeks, 4 days ago
Selected Answer: A
Should be A https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_for_update.htm
upvoted 2 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 ...