+ Start a Discussion
JJenkinsJJenkins 

Validation Rule in Leads

I'm trying to create a validation rule in the leads section that goes like this:

 

If the "Division" field (picklist) equals "this text" and the "lead status" (picklist) is equal or greater than "Qualified" then the "Product" field (picklist) is required.

 

Here is what I have so far

 

AND (ISPICKVAL (Division__c, "TEXT"), ( ISPICKVAL (Status, "Qualified, Top Qualified")), ISNULL ( SM_Product__c ))

 

 

I am getting the error of "Field SM_Product is a picklist field and cannot support "ISNULL"

 

Any help is appreciated.  I am using P/E if that helps.

 

Thanks,

Message Edited by JJenkins on 06-16-2009 10:46 AM
Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/
Give this one a shot

AND((ISPICKVAL( Division__c , "Staff Management")), AND(OR (ISPICKVAL (Status, "Qualified"), (ISPICKVAL (Status, "Top Qualified")))), AND(ISPICKVAL( SM_Product__c ,"")))

 

All Answers

Steve :-/Steve :-/

I'm pretty sure that for picklist fields you have to use "" instead of ISNULL 

 

 

Just an FYI, when you're posting code here you should use the [c] clipboard in the Editor, so you don't end up with a bunch of emoticons in your code.  

JJenkinsJJenkins

Thanks for letting me know how to post code without smileys.

 

here is where I'm at now and it is saying i have an Extra start parenthesis

 

AND (ISPICKVAL (Division__c, "VALUE")) && ( ISPICKVAL (Status, "Qualified, Top Qualified")) && "" (" SM_Product__c" )

 

Steve :-/Steve :-/
I don't think you can use ISNULL if your SM_Product_c field is a picklist, I think you need to change it to :

ISPICKVAL( SM_Product__c ,"")

 

 Also, I'm not sure about using && in your formula instean of the literal AND/OR statements
and I think you need to evaluate your Status field in seperate ISPICKVAL statements too

ISPICKVAL (Status, "Qualified"),ISPICKVAL (Status, "Top Qualified")

 

 
 
 
 
Message Edited by Stevemo on 06-16-2009 02:14 PM
JJenkinsJJenkins

We're getting close Stevemo - I can feel it.

 

thanks for all your help with this

 

AND (ISPICKVAL (Division__c, "Staff Management")) (ISPICKVAL (Status, "Qualified")), (ISPICKVAL (Status, "Top Qualified")) AND (ISPICKVAL( SM_Product__c ,""))

With the code above it is saying i have one to many left parenthesis

Steve :-/Steve :-/
Give this one a shot

AND((ISPICKVAL( Division__c , "Staff Management")), AND(OR (ISPICKVAL (Status, "Qualified"), (ISPICKVAL (Status, "Top Qualified")))), AND(ISPICKVAL( SM_Product__c ,"")))

 

This was selected as the best answer
JJenkinsJJenkins

you're brilliant!

 

thanks

Steve :-/Steve :-/
wait'll you get my bill...
JakesterJakester
Stevemo nails another one! Great job. BTW, they did enable the && and || syntax recently - I think it was in Winter '09.
Steve :-/Steve :-/

Thanks for the tip Jakester, I didn't know about the change to SF Formula Language

 

 

S:-/