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?
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
custom settings can be included in Salesforce packages, but only the definition is included, not the data. To include data, the subscribing organization must populate the custom settings after installing the package.
So i guess D is the answer
As far as we use package, we cannot use custom settings, coz in package we cannot put data, metadata only.
Then we may use SOQL, or .getAll().keySet() and use if we put currency into DeveloperName field.
Ugly question. Both getAll() methods return maps... but I believe custom metadata is more preferable. So even A looks also true as it will return list - as in requirements :) but it is not optimal because of query.
Maybe custom settings are better suited for storing Lists, but yeah both answers B and D seems plausible for the usecase.
upvoted 1 times
...
...
Log in to ExamTopics
Sign in:
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.
beardAnt
1 month agoFriedConsole2000
9 months agoUllr
1 year, 7 months agoOmShantiVeg
2 years, 3 months agoOmShantiVeg
2 years, 3 months agosiiwoo
2 years, 4 months agoFlamebird
2 years, 11 months agoawaisoo
2 years, 11 months agoMt25
3 years agoncore
2 years, 11 months ago