Salesforce Certified Platform Developer II — Question 158
An org has a requirement that the Shipping Address on the Account must be validated by a third-party web service, before the Account is allowed to be inserted. This validation must happen in real-time before the account is inserted into the system. Additionally, the developer wants to prevent the consumption of unnecessary SME statements.
What is the optimal way to meet this requirement?
Answer options
- A. Make a callout to the web service from a custom Visualforce controller.
- B. Make a callout to the web service from a before insert trigger.
- C. Make a callout to the web service from a standard Visualforce controller.
- D. Make a callout to the web service from an after insert trigger.
Correct answer: A
Explanation
The correct answer is A because using a custom Visualforce controller allows for real-time validation of the Shipping Address before insertion, fulfilling the requirement. Options B and D are incorrect as triggers do not support callouts in the before or after context, and option C does not allow for the customization needed for this specific requirement.