Salesforce Certified Platform Developer II — Question 67
A managed package uses a list of country ISO codes and country names as reference data in many different places from within the managed package Apex code.
What is the optimal way to store and retrieve the list?
Answer options
- A. Store the information in Custom Metadata and query it with SOQL
- B. Store the information in a List Custom Setting and access it with the getAll() method
- C. Store the information in a List Custom Setting and query it with SOQL
- D. Store the information in Custom Metadata and access it with the getAll() method
Correct answer: B
Explanation
The correct answer is B because List Custom Settings provide a way to store application data that can be accessed easily and quickly using the getAll() method. Other options either involve using SOQL, which is less efficient for this purpose, or suggest using Custom Metadata, which is not as convenient for frequently accessed lists as List Custom Settings.