Salesforce Certified Platform App Builder — Question 5
You need to ensure that the value in a custom field "Source Country" is validated against the standard list of ISO countries that are valid for the particular type of order, when the order is saved.
What is the best way to achieve this requirement?
Answer options
- A. Create a validation rule using a CASE statement.
- B. Create a validation rule using the VLOOKUP function.
- C. Create a before trigger and validate the value using APEX code.
- D. Create an after trigger and validate the value using APEX code.
Correct answer: B
Explanation
The correct answer is B because the VLOOKUP function is specifically designed to compare values against a list, making it ideal for validating the 'Source Country' against the ISO country list. The other options, while potentially useful, either do not provide the necessary functionality (like CASE statements) or involve triggers that execute at different times in the order process, which do not meet the requirement of validation at the save event.