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
ArunForceArunForce 

Writing validation rules on custom object by refering custom setting field values

Hi ,
I want to write the validation rules on cstom object.I am atoring some configuration values in customsettings. NowIwanttowritetherulesayingthat 'customobject__c.period__c=$Setup.customsettings__c.period__c'. But it is giving the syntax error. Can we refer the custom setings values inside the validation rules?If not what are the alternatives we have.
Can someone please help me to solve this issue.


thanks,
Arun.

Vinita_SFDCVinita_SFDC

Hello,

 

Yes you can refer a Custom setting in Validation rule. Which type of data is stored in your custom setting $Setup.customsettings__

c.period__c and are you checking if if a custom field is equal to a custom setting value? You can simply refer the field with its name, without having object name in prefix, if it is not a cross object validation rule.

JaanuJaanu
can't we write trigger on custom settings object to resolve my problem ?