Loading
Extend Salesforce with Clicks, Not Code
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Define Custom Settings

          Define Custom Settings

          Create custom sets of data.

          Required Editions

          Available in: Salesforce Classic and Lightning Experience.

          Available in: Group, Professional, Developer, Enterprise, Performance, Unlimited, and Database.com Editions.

          Packages aren’t available in Database.com.

          User Permissions Needed
          To manage, create, edit, and delete custom settings: Customize Application
          Note
          Note We strongly suggest using custom metadata types instead of custom settings. Unlike list custom settings, you can migrate the records of custom metadata types using second-generation packages or Metadata API tools.

          To create a custom setting:

          1. From Setup, enter Custom Settings in the Quick Find box, then select Custom Settings.
          2. Click New.
            Note
            Note A Managed - Installed icon indicates that the custom setting is in an installed managed package. You can’t edit or delete a protected custom setting installed from a managed package.
          3. Give the custom setting a label.
            Enter the label displayed in the application.
          4. Define the object name.
            Enter the name to be used when the custom setting is referenced by formula fields, validation rules, Apex, or SOAP API.
            Note
            Note Salesforce recommends using ASCII for the Object Name. The name can't exceed 38 ASCII characters. If you use double byte, there are additional limits on the number of characters allowed.
          5. Define the setting type.
            Select a type of List or Hierarchy. After you save a custom setting, you can’t change this value.
            • List—Defines application-level data, such as country codes or state abbreviations, and provides a reusable set of static data that can be accessed across your organization. If you use a particular set of data frequently within your application, putting that data in a list custom setting streamlines access to it. Data in list settings does not vary by profile or user, but it is available organization-wide. Examples of list data include two-letter state abbreviations, international dialing prefixes, and catalog numbers for products. Because the data is cached, access is low-cost and efficient—you don't have to use SOQL queries that count against your governor limits.
            • Hierarchy—Uses a built-in hierarchical logic that lets you personalize settings for specific profiles or users. The hierarchy logic checks the organization, profile, and user settings for the current user and returns the most specific, or lowest, value. In the hierarchy, settings for an organization are overridden by profile settings, which, in turn, are overridden by user settings.
          6. Define the visibility setting.
            (Available in developer and scratch orgs) After you save a custom setting, you can’t change this value.
            • Protected—If the custom setting is contained in a managed package, subscribing organizations can't see the custom setting—it doesn't display as part of the package list. In addition, subscribing organizations can't access the custom setting using Apex or the API. Custom settings can only be accessed by the Apex code that is part of the managed package. If the custom setting is contained in an unmanaged package, they behave like public custom settings.
            • Public—Regardless of the type of package (managed or unmanaged), the following have access: Apex, formulas, flows, and API for users with Customize Application permission or permissions granted through profiles or permission sets.
          7. Enter an optional description of the custom setting. A meaningful description helps you remember the differences between your custom settings when you view them in a list.
          8. Click Save.

          After you create a custom setting, add fields to the custom setting.

          • Add Custom Settings Fields
            After you define custom settings, add fields to them. The custom fields contain the data used by the custom setting.
          • Create Custom Settings Records
            After you define your custom settings and add fields, you can populate the fields with data.
          • Manage Custom Settings Data
            After creating custom setting and adding fields, you can add records, then use the values in these records in your Apex code and validation rules.
           
          Loading
          Salesforce Help | Article