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

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

An org has a requirement that an Account must always have one and only one Contact listed as Primary. So selecting one Contact will de-select any others. The client wants a checkbox on the Contact called 'Is Primary' to control this feature. The client also wants to ensure that the last name of every Contact is stored entirely in uppercase characters.
What is the optimal way to implement these requirements?

  • A. Write an after update trigger on Contact for the Is Primary logic and a separate before update trigger on Contact for the last name logic.
  • B. Write a Validation Rule on the Contact for the Is Primary logic and a before update trigger on Contact for the last name logic.
  • C. Write an after update trigger on Account for the Is Primary logic and a before update trigger on Contact for the last name logic.
  • D. Write a single trigger on Contact for both after update and before update and callout to helper classes to handle each set of logic.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
peixotmarc
1 year, 2 months ago
Selected Answer: D
For me it is D. C does not make sense for me, because how you will control is Primary when you will be adding a new contact if the trigger is in Account? Also, for me, the best solution is a trigger in Contact for Is Primary and a validation rule for the LastName
upvoted 1 times
...
John1212
1 year, 2 months ago
C is Correct
upvoted 1 times
...
karappo
1 year, 9 months ago
1st thing to consider probably is 1 trigger per object
upvoted 1 times
...
lorenac2
1 year, 10 months ago
More information on apex best practices: https://www.salesforceben.com/12-salesforce-apex-best-practices/
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 ...