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
PubNoahPubNoah 

Validation: Picklist Required if Checkbox is selected

Hello,

 

I am trying to make a field required if a check box is selected.  The check box is called "Is_Publisher_Currently_Live__c" and the field is called "AdSize_728x90__c."  

 

Below is what I did.  The problem is that the validation is not recognizing the "--None--" value of the picklist, since it is a default addition to the picklist.  Please help!

 

-----

AND( 
Is_Publisher_Currently_Live__c, 
ISPICKVAL( AdSize_728x90__c, "--None--") 
)

-----

 

Thanks,

Noah

DonSpilkyDonSpilky

--None-- is really empty.  Try that instead.

PubNoahPubNoah

No, that doesn't work.  When I put it in quotes, it does not work, presumably because it is looking for value: "empty" without quotes.  When I take it out of quotes, I get an error message saying "Error: Field empty does not exist. Check spelling."

 

Any other thoughts?

Jeff TalbotJeff Talbot

This syntax should work for your validation rule:

 

AND( 
           Is_Publisher_Currently_Live__c, 
           ISBLANK(TEXT(AdSize_728x90__c)) 
         )

PubNoahPubNoah

Worked!  Thanks for your help.