1

This does not seem to be working. Checking the syntax does not give me an error. As I can successfully query for the values inside the quotes (i.e., Member, Voting Member), these values are valid.

I could not find any example like this so maybe it has to be structured a different way?

AND(
  NOT(ISPICKVAL(Voting_Member__r.Type,"Member")),
  NOT(ISPICKVAL(Voting_Member__r.Member_Status__c, "Voting Member"))
)
2
  • What is your requirement? Something like if Voter Member Type is Member or Member Status Voting Member, you want to allow insert/update else block? You can phrase this like below, NOT(AND(ISPICKVAL(Voting_Member__r.Type, "Member"),ISPICKVAL(Voting_Member__r.Member_Status__c, "Voting Member"))) If you provide clarity on your requirement would be able to help. Aug 29 '19 at 14:08
  • The requirement is to only allow a company where it is type is a member and a member status is voting member.. The field being validated is a lookup(Account) and the two values are both picklist values in the account object. The field being validated is a related object.
    – Daryn
    Aug 29 '19 at 14:42
3

If you want to allow only a company where type is Member and member status is Voting Member, then your validation rule should be

NOT(
    AND(
        ISPICKVAL(Voting_Member__r.Type, "Member"),
        ISPICKVAL(Voting_Member__r.Member_Status__c, "Voting Member")
    )
)

The problem with your current validation rule is you are having AND conditon which means the rule will fire only when both the criteria matches, whereas you want the rule to fire when either of them does not match. You also can use OR like below which will evaluate to same as above mentioned condition.

OR(
    NOT(ISPICKVAL(Voting_Member__r.Type, "Member")),
    NOT(ISPICKVAL(Voting_Member__r.Member_Status__c, "Voting Member"))
)
2
  • Well explained and it makes perfect sense now. Thank you Vijay!
    – Daryn
    Aug 29 '19 at 15:11
  • @Daryn Glad to help you ! Aug 30 '19 at 3:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.