How to Create Custom Settings in Salesforce



The Custom Settings are similar to Objects with one major benefit being they don’t need to be queried using SOQL. They create and manage custom data at the organization, profile, and user levels. Custom settings data are stored in the application cache and that means we can access it efficiently and it is used by formula fields, Visualforce, Apex, and the Web Services API. There are two types of Custom Settings – List and Hierarchy.

 They used to create custom sets of data that can be associated with an organization, profile for a specific user.

Setting up Custom Settings

Click on New and Create Custom Settings Object Name.

If the setting type is disabled, go to the schema settings from setup enable Manage list custom settings type.

Custom Fields
Custom Fields will contain different types and Create which type of fields. After you define custom settings, add fields to them. The custom fields contain the data used by the custom setting.

After creating a custom setting and adding fields, you can add records and use the values in these records in your Apex code and validation rules. To create records –

  • Click New or Edit next to an existing data set. Add or change data.

Limits on Custom Settings

They are Few limits that need to be considered,

  • We can have up to 300 fields per custom setting.
  • Sharing a Custom Setting object or record is not possible.
  • The Custom Settings are a type of custom object, each custom setting counts against the total number of custom objects available in salesforce org.
  • The total amount of cached data allowing for your org is the lesser of these two values:
    • 10 MB
    • 1 MB multiplied by the number of full-featured user licenses in your org.

For more Blogs: https://blog.merfantz.com/

Reference from: click here