Custom settings enables application developers to create custom sets of data, as well as create and associate custom data for an organization, profile, or specific user. All 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, Apex, and the SOAP API.
Using Custom Setting enables a developer to
change the values in production without deploying the code again for the change
in value.
Custom Settings can be used for URLS where
URL may changes time to time and for the triggers which may have a requirement of
deactivating and activating again.
How To Access Custom Settings
Methods used to get values-
- getAll()
- getValues(data_set_name)
- getOrgDefaults()
- getInstance(Profile_ID)
Step 1. Creating a custom setting and Custom
field.
Step 2:- Click on Manage to insert data in custom
setting. In this case we are adding custom URL which will be access by our code.
Step 3- Inserted Value in custom Setting.