function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
poonam wadhwani 9poonam wadhwani 9 

List Custom Setting reference to Validation rule

Can I reference my List type of Custom Setting in my validation rule ?If yes can anyone please let me know how?

Thanks.
Prasad Avala(SFDC)Prasad Avala(SFDC)
Hi Poonam,
Custom settings are just like Objects which can be referenced in apex code or Validations.

Please check the below link:
https://developer.salesforce.com/forums/?id=906F00000008w3MIAQ
Prasad Avala(SFDC)Prasad Avala(SFDC)
Below is the example how to use custom settings:

AND(NOT($Setup.Opportunity_Web__c.Exclude_Marketing_for_Web__c)

Opportunity_Web__c is a custom settings object and Exclude_Marketing_for_Web__c is a field on that custom settings.

Note:  Need to use $Setup to access custom settings.
SalesFORCE_enFORCErSalesFORCE_enFORCEr
Custom settings of type List cannot be used in formulae and validations
Prasad Avala(SFDC)Prasad Avala(SFDC)
Shalabh is right, You can access only hierarchy type of custon setting in Validations. I might missed it though it was mentioned in the question.