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
lburnslburns 

Formula/Validation Rule for Required Picklist field.

 Hi...trying to make a picklist field required when the standard 'TYPE' field (also a picklist field) is populated with 'Vendor'.  If 'Vendor' is selected, then I need to have the 'Vendor Group' field required.

 

 

AND(


    ISPICKVAL( Type ,"Vendor"),
    ISPICKVAL( Vendor_Group__c ) (am I missing something here?)

)

 

I tried the ISNULL function, but it keeps giving me an error that it's a picklist.

 

Thanks...

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

Try changing it to 

ISPICKVAL( Vendor_Group__c ,"")

 

 

 

All Answers

Steve :-/Steve :-/

Try changing it to 

ISPICKVAL( Vendor_Group__c ,"")

 

 

 

This was selected as the best answer
lburnslburns
Perfect..thank you!
NalesNales

I'm wondering if this formula will help me. I'm trying to make an Opportunity field required based on a Opportunity picklist Type Field "New Business"

 

AND(


ISPICKVAL( Type ,"New_Business" ),
ISPICKVAL( Inside_Sales_Rep__c," ")

)

Steve :-/Steve :-/

 Yeah, this  one should work for you

 

 

AND(ISPICKVAL(Type, "New_Business"), (ISPICKVAL(Inside_Sales_Rep__c, "")))

 

 

NalesNales

I tried it and not working. Wondering if reasons b/c both are picklists. Trying to figure another way....

 

 

AND(ISPICKVAL (Type, "New Business"), ISNULL (Inside_Sales_Rep__c) )

 

If I think this out, if Opportunity Type = New Business, then Inside Sales Rep should not be blank, and required..however still not working.

 

Steve :-/Steve :-/
Are you using the formula that I posted or the one that is in your post?  I just tested mine on 2 Picklists making the second Picklist Required if the first Picklist has a specific value selected, and it works fine. 
NalesNales
Here is the code.

AND(ISPICKVAL(Type, "New_Business"),
(ISPICKVAL (Inside_Sales_Rep__c, "")))

The Inside Sales Rep is a field and not a picklist. That might be the problem.

Steve :-/Steve :-/
Wait, what are the datatypes and values for both fields?  In your earlier posts you said that they are BOTH picklists, now you're saying that one of them is a field.  Is it a picklist, a text field, a lookup, or something else?
Message Edited by Stevemo on 10-05-2009 05:24 PM
NalesNales

Sorry about that.

 

Field Label - Type

Field Name - Type

Data Type - Picklist ( one of the values is "New Business"

 

Field Label - Inside Sales Rep

Field Name - Inside_Sales_Rep

API Name - Inside_Sales_Rep_c

Data Type - Picklist ( filled with user names)

 

Steve :-/Steve :-/
If the field that you want to make required is a Text field, and the trigger field for the requirement is a Picklist, then try this one.

 

 

AND( ISPICKVAL(Type, "New_Business"), LEN( Inside_Sales_Rep__c) < 1)

 

 

NalesNales

Actually its a picklist field and here is a error I get. I'm going to review the formula pdfs you attached in other posts.

 

Error: Field Inside_Sales_Rep__c is a picklist field. Picklist fields are only supported in certain functions.

 

 

 

Steve :-/Steve :-/

Also, in some posts your formula has a value of "New Business" and in others it's "New_Business" so you might want to check that too.

 

If they are both PICKLIST Fields then this formula should work fine:

 

AND(ISPICKVAL(Type, "New Business"), (ISPICKVAL(Inside_Sales_Rep__c, "")))

 

Are all of the fields in your formula located on the Opportunity Object?

Message Edited by Stevemo on 10-05-2009 05:40 PM
NalesNales

That was the error. I was using "New_Business" instead of the correct way "New Business. Thanks again for the help and patience.

 

Chris

Steve :-/Steve :-/
No problem, that's why they pay me the BIG Bucks!