0

I have a validation rule and I would like to restrict the two fields(both are blank). How can i achieve this?

AND(
  NOT( $Setup.User_Configuration__c.Account_Validation_Rules__c ),
  NOT(OR(
    $Profile.Name = 'Integration', 
    $Profile.Name = 'System Administrator'
  )),
  OR(
    ISCHANGED( Name ),
    ISCHANGED( Phone ),
    ISCHANGED( RecordTypeId ),
    ISCHANGED(Client__c), 
    ISCHANGED(Local__c)  
  )
)
1
  • which field you want to restrict from keeping it blank??
    – Avijit Das
    May 19, 2017 at 9:41

1 Answer 1

0

You can add in more values in your OR function:

AND(
  NOT( $Setup.User_Configuration__c.Account_Validation_Rules__c ),
  NOT(OR(
    $Profile.Name = 'Integration', 
    $Profile.Name = 'System Administrator'
  )),
  OR(
    ISCHANGED( Name ),
    ISCHANGED( Phone ),
    ISCHANGED( RecordTypeId ),
    ISCHANGED(Client__c), 
    ISCHANGED(Local__c),
    ISBLANK(FieldA__c),
    ISBLANK(FieldB__c)
  )
)

However, in complicated objects, I'd recommend avoiding doing this, because you can't attach the error to the correct field. Use multiple validation rules.

You must log in to answer this question.

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