+ Start a Discussion
Harshitha KashyapHarshitha Kashyap 

I have to validate some fields in a custom object,but those fields differ for different clients so i want to make use of custom settings to achieve that,so that in future i wouldnt have to make changes in the code

But I dont know how to proceed,Can someone help me to understand more about custom settings
SHAHNA MULLASHAHNA MULLA

Hi Harshitha,
  • Custom settings are similar to custom objects.
  • It enable 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, flows, Apex, and the SOAP API.
  • There are two types of custom settings:
  • List Custom Settings:
  • 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.
  • Eg : 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.
  • Hierarchy Custom Settings:
  • 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.
  • Eg : 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.
  • You can also include a custom setting in a package. The visibility of the custom setting in the package depends on the Visibility setting.

Check below link to know the steps to create a Custom Setting,
https://help.salesforce.com/articleView?id=cs_define.htm&type=5

Thanks........