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
Lisa BanksLisa Banks 

Can I use ISPICKVAL to validate more then one pick list value in a validation rule?

I'm using the validation rule below to check if the billing period field is blank when the opportunity stage is Compliance and it works perfectly, but 
I actually have 3 more pick list values (Conditions Met, Funded and No Sale) I'd to check if the billing period is blank. What is the syntax for this? I've done many searches and can't find an answer. I feel like this is so simple. Thanks for your help.

ISPICKVAL(Stage__c,"Compliance") 
&& ISBLANK(Billing_period__c)
Leonardi KohLeonardi Koh
you can use the OR formula syntax to place 4 ISPICKVAL joined together with the OR which basically means that if the formula sees any one of the 4 ISPICKVAL (one for each of the pick list values you mentioned) then it will satisfy the condition and does the second check for the Billing_period__c

so for the 4 ISPICKVAL it would be
OR(ISPICKVAL(Stage__c,"Compliance"), ISPICKVAL(Stage__c,"Conditions Met"), ISPICKVAL(Stage__c,"Funded "), ISPICKVAL(Stage__c,"No Sale)")) then you can add the ISBLANK at the end
Lisa BanksLisa Banks
Thank you! *Lisa Lee-Banks* *Certified Salesforce Consultant* *Driving Salesforce Adoption*
Lisa BanksLisa Banks
I also want to check if the billing period (date field) is greater then the closing date field when the user enters the billing period. Is it possible to use the same rule for this or do I have to create a second rule? *Lisa Lee-Banks* *Certified Salesforce Consultant* *Driving Salesforce Adoption*
Leonardi KohLeonardi Koh

in this particular rule though you are checking if the Billing_Period__c is blank

which is going to be a bit of a problem if you try to check if it's greater than closing date field in the same rule because naturally if the Billing Period is blank, then it's never gonna be greater than the closing date field (unless if it's also blank), so my gut says it's going to be a different rule.

note that i am not aware of the context of the requirement so i am just going by pure logic for what you mentioned here.

Lisa BanksLisa Banks
I think you're right, that makes sense. I'll see if I can figure out the syntax for comparing 2 date fields. *Lisa Lee-Banks* *Certified Salesforce Consultant* *Driving Salesforce Adoption*