Salesforce Certified Platform Developer II — Question 272
An org has a requirement that addresses on Contacts and Accounts should be normalized to a company standard by Apex code any time that they are saved.
What is the optimal way to implement this?
Answer options
- A. Apex trigger on Contact that calls the Account trigger to normalize the address
- B. Apex triggers on Contact and Account that normalize the address
- C. Apex trigger on Account that calls the Contact trigger to normalize the address
- D. Apex triggers on Contact and Account that call a helper class to normalize the address
Correct answer: A
Explanation
The correct answer is A because it allows for a streamlined approach where the Contact trigger directly invokes the Account trigger to handle address normalization, ensuring that the process is efficient and avoids duplication. Options B and D involve multiple triggers running independently, which could lead to complexity and potential performance issues. Option C incorrectly suggests that the Account trigger should control the normalization for Contacts, which is not optimal in this scenario.