Create Custom Settings
Use custom settings to create custom sets of data, or to create and associate custom data for an org, profile, or user.
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 | |
|---|---|
| Customize Application | |
Custom settings are similar to custom objects in that they let you customize org data. Unlike custom objects, which have records based on them, custom settings let you utilize custom data sets across your org. Custom settings also let you distinguish particular users or profiles based on custom criteria.
Custom settings data is exposed in the application cache, which enables efficient access without the cost of repeated queries to the database. This data can then be used by formula fields, validation rules, flows, Apex, and SOAP API
- Review the protection and privacy options.
- Create the custom setting.
- Add fields and data.
- Reference the custom setting data in your application using formula fields, validation rules, Apex, or SOAP API.
These examples illustrate how you can use custom settings.
- A shipping application requires users to fill in the country codes for international deliveries. By creating a list setting of all country codes, users have quick access to this data without needing to query the database.
- An application calculates and tracks compensation for its sales reps, but seniority determines commission percentages. By creating a hierarchy setting, the administrator can associate a different commission percentage for each profile in the sales organization. Within the application, one formula field can then be used to calculate compensation for all users. The personalized setting at the profile level inserts the correct commission percentage.
- An application displays a map of account locations, the best route to take, and traffic conditions. This information is useful for sales reps, but account executives only want to see account locations. By creating a hierarchy setting with custom checkbox fields for route and traffic, you can enable this data for just the Sales Rep profile.
- Protection and Privacy Options for Custom Settings
Manage the visibility and permissions of custom settings. - Define Custom Settings
Create custom sets of data. - View and Edit Custom Settings
After you create a custom setting, you can view the details of the custom setting, manage the custom setting, and add fields. - View Custom Settings Usage and Data
View the percentage of custom settings data your org has used. - Grant Permissions on Custom Settings
By default, access to custom settings is limited through the Restrict access to custom settings org-wide preference. Admins can grant API Read access through profiles and permission sets to users without the Customize Application permission. - Grant Read Access to All Custom Settings
Admins with the Customize Application permission can grant API read access to all custom settings. - Access Custom Settings with Code
You can access custom settings from Apex, SOAP API, and formulas. - Custom Settings Limits and Considerations
When working with custom settings, be aware of the following considerations and limits on the amount of cached data.

