Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Certified Platform Developer II All Questions

View all questions & answers for the Certified Platform Developer II exam

Exam Certified Platform Developer II topic 1 question 221 discussion

Actual exam question from Salesforce's Certified Platform Developer II
Question #: 221
Topic #: 1
[All Certified Platform Developer II Questions]

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
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️
Reference:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_customsettings.htm

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
beardAnt
1 month ago
Selected Answer: D
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
upvoted 1 times
...
FriedConsole2000
9 months ago
Selected Answer: D
I believe "D" is the best answer.
upvoted 1 times
...
Ullr
1 year, 7 months ago
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.
upvoted 1 times
...
OmShantiVeg
2 years, 3 months ago
Ans is D CustomMetadata__mdt.getAll().values(); will return a list
upvoted 3 times
OmShantiVeg
2 years, 3 months ago
It's not even possible to create new list custom settings as far as I know
upvoted 1 times
...
...
siiwoo
2 years, 4 months ago
Whe isn't c?
upvoted 1 times
...
Flamebird
2 years, 11 months ago
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.
upvoted 1 times
...
awaisoo
2 years, 11 months ago
The list type custom setting is no more recommended by salesforce based on that fact should the answer still be 'B'?
upvoted 1 times
...
Mt25
3 years ago
Answer Should not be 'D' ?
upvoted 1 times
ncore
2 years, 11 months ago
Maybe custom settings are better suited for storing Lists, but yeah both answers B and D seems plausible for the usecase.
upvoted 1 times
...
...
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.

SaveCancel
Loading ...