1

I need to write a validation rule on case so that cases of record type A,B,C,D,E cannot be created for Accounts of record type F. Can i create this validation rule in configurable way by storing case record types A,B,C,D,E in any hierarchy custom setting, label etc. which can be used in the validation rule.

AND(
    OR(
        RecordType.DeveloperName ="A",
        RecordType.DeveloperName ="B",
        RecordType.DeveloperName ="C",
        RecordType.DeveloperName ="D",
        RecordType.DeveloperName ="E"
    ),
    Account.RecordType.DeveloperName = "F"
)
1
  • AND( CONTAINS( $Setup.Hierarchy_Custom_Setting__c.Recordtype__c , RecordType.DeveloperName ), Account.RecordType.DeveloperName = "F" )
    – Walker
    Jul 24, 2017 at 14:01

1 Answer 1

3

Yes, it is possible to use only hierarchy custom settings in validation rules.

$Setup.CustomSettingName__c.CustomSettingFieldName__c

So your formula for validation rule will look like:

AND(
    OR(
        RecordType.DeveloperName = $Setup.CustomSettingName__c.CustomSettingFieldNameA__c,
 ...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .