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
HaigyHaigy 

Picklist Value Required if Date Closed is Populated

I am just going round in circles here so hopefully someone can help me please.
 
I have a 'Date Closed' field and picklist field. I want to say if Date closed has a date populated then a picklist value must be selected or you cannot save the record.
 
Hope that makes sense.
James
NPMNPM

You need to set up a validation rule. 

Also Search in Help and Training for "NULL" and look at the ISNULL function.  There is great information and validation rule examples to start with.

HaigyHaigy
Sorry forgot to mention I know about validation rules that is were I am struggling I can do the validation rule so that:
 
If Picklist = Value then date must be entered just can't figure out how to do it the other way around.
 
James
NPMNPM
Here is one way.  Substitue your field names.
 
Code:
AND (NOT( ISNULL(Date__c ) ), ( ISPICKVAL(Test_Values__c, "None" )))

 
NPMNPM
Sorry about that - sent too soon - still working on it.
NPMNPM

This works- I had another test validation rule active that messed me up earlier.

Code:
AND (NOT( ISNULL(Date__c ) ), ISPICKVAL( Test_Values__c , ""))


 

HaigyHaigy

Many thanks for your fast response it works perfectly.

Regards
James