+ Start a Discussion
nickfs92840nickfs92840 

Validation Rule from a picklist value and date field

I have a picklist value named: Negotiation Status and an item named - Terminated that is within the picklist. 

 

I setup another field called Termination Date.

 

What i'm trying to accomplish is when a user selects Terminated from the Negotiation Status picklist, the Termination Date field must be a required field in which the user must enter a date.   

 

Can someone help me in the correct validation rule - error condition formula I can use to execute this? 

 

Salesforce API Names: 

Negotiation Status: Negotiation_Status__c

Termination Date: Termination_Date__c 

 

 

Message Edited by nickfs92840 on 01-14-2010 11:01 AM
Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

Try something like this

 

AND(ISPICKVAL(Negotiation_Status__c, "Terminated"),ISNULL(Termination_Date__c))

 

 

All Answers

Steve :-/Steve :-/

Try something like this

 

AND(ISPICKVAL(Negotiation_Status__c, "Terminated"),ISNULL(Termination_Date__c))

 

 

This was selected as the best answer
nickfs92840nickfs92840
Thanks Stevemo! You solved it once again! :smileytongue:
vandemanjwvandemanjw

Thanks, this was really helpful!

 

I am also trying to create a validation rule form a picklist value to a text field, but I get this error when I use the posted solution:

 

Error: Formula result is data type (Boolean), incompatible with expected data type (Text).

 

Any suggestions?

Steve :-/Steve :-/
Can you post your Formula Code using the Code Clipboard, along all of the detail about the fields, datatypes, and values?
vandemanjwvandemanjw

I'm no longer recieving the error message, but the validation rule is not functioning:

 

 

AND(ISPICKVAL(Payment_Terms__c, "Other Terms"),ISNULL(Other_Payment_Terms__c))

 

 

Picklist field: Payment_Terms__c

Picklist value: Other Terms

Textbox: Other_Payment_Terms__c

 

The validation rule seems to be fine, but when I select the picklist value, the textbox field is still not required before saving.

 

 

Steve :-/Steve :-/
Try using a LEN function on your Text field
vandemanjwvandemanjw
Thanks Stevemo.  I'm not exactly sure how the LEN function would help in this situation.  I've tried including it in my formula, but still no results.
Steve :-/Steve :-/

Can you post your the formula with the LEN function that you are using?  It should look something like this

 

 

AND(ISPICKVAL(Payment_Terms__c , "Other Terms"),LEN(Other_Payment_Terms__c) < 1)

 

 

 

vandemanjwvandemanjw
Thanks Stevemo, this did it!  I was approaching it from the wrong angle, thanks for the clarification.