Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full List Custom Settings entry
How-to guide

Create and access a List Custom Setting

Creating a List Custom Setting involves schema definition, data population, and Apex access. The steps below cover the full setup.

By Dipojjal Chakrabarti · Founder & Editor, Salesforce DictionaryLast updated May 19, 2026

Creating a List Custom Setting involves schema definition, data population, and Apex access. The steps below cover the full setup.

  1. Decide List versus Hierarchy versus CMDT

    List for per-record-identified-by-name configuration. Hierarchy for per-user variance. CMDT for shared reference data that should deploy with releases.

  2. Create the Custom Setting

    Setup > Custom Settings > New. Name it, set Type to List, choose Public or Protected visibility. Save.

  3. Add fields

    From the detail page, add fields for the values you need (Text, Number, Email, Checkbox). Field types are limited; complex types require a custom object instead.

  4. Populate records

    Manage > New. Add records with Name and field values. For bulk, use Data Loader.

  5. Access from Apex

    Call MySetting__c.getValues('SomeName') for one record. Call MySetting__c.getAll() for the full map keyed by Name.

  6. Plan deployment

    Schema deploys through changesets. Data does not. Write a post-deployment Apex script or Data Loader job to populate each target environment.

  7. Document the setting

    Add field-level help text and a comment in the Apex code referencing the setting. Future developers will need to understand the purpose.

Key options
Name fieldremember

Primary identifier for each record. Use a meaningful naming convention.

Field typesremember

Text, Number, Email, Checkbox, Phone, URL, etc. Limited compared to custom objects.

Public visibilityremember

Accessible from any Apex code. The standard choice.

Protected visibilityremember

Accessible only within the same namespace. For managed packages.

getValues() versus getAll()remember

One record by name versus all records as a Map.

Gotchas
  • Data does not deploy through changesets. Plan recreation or population in each environment.
  • 10 MB cap across all Custom Settings. Hitting it blocks new records.
  • Update propagation takes a few seconds. Immediate reads may see stale values.
  • Field types are limited. For complex configuration, use a custom object instead.
  • Custom Metadata Types are the modern alternative for deployable configuration. Reach for them first.

See the full List Custom Settings entry

List Custom Settings includes the definition, worked example, deep dive, related terms, and a quiz.