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
FranckFranck 

Validation rule to prevent picklist field update if a date field is populated.

Hi,

I would like to prevent picklist value update if a date field is already populated.

Could you please help me?

Thanks
Best Answer chosen by Franck
VinayVinay (Salesforce Developers) 
Try below
AND(NOT(ISBLANK(Datefield)),  ISCHANGED(Picklistfield))

Please mark as Best Answer if above information was helpful.

Thanks,

All Answers

VinayVinay (Salesforce Developers) 
Try below
AND(NOT(ISBLANK(Datefield)),  ISCHANGED(Picklistfield))

Please mark as Best Answer if above information was helpful.

Thanks,
This was selected as the best answer
FranckFranck
Thanks Vinay but the validation is displayed even if the date field is empty...

Do you have an idea how we can refine the validation rule please?

Thank you
VinayVinay (Salesforce Developers) 
I have tested and it didn't fire when the date field is blank.  Can you re-check also check if there is any existing validation rule that is firing or else share screenshot of error?

Thanks,
FranckFranck
User-added image

Sorry but as you can see the send date field is empty and the validation rule is displayed.

Here is the formula : 
AND(NOT(ISBLANK(Send_date__c)), ISCHANGED(Transmis_au_partenaire_picklist__c))

Data TypeDateof of the field "Send date" is date.
VinayVinay (Salesforce Developers) 
It's working for me as expected.

Let's do other way can you create new sample date field and picklist field and check? Include new fields in validation rule and later you can delete them.

Thanks,
FranckFranck
Thank you Vinay i create a new date field and it works !

Many Thanks.
VinayVinay (Salesforce Developers) 
Good to know...

Please mark as Best Answer if above information was helpful.

Thanks,
FranckFranck
Done Thank you Vinay