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
TigerPowerTigerPower 

Make picklist field OR text field required

I have a case where picklist field value has to be selected, or user must fill in a custom text field. In other words, whether the picklist field or the text field is required.

 

I have already a validation rule running on these same fields saying that user may only choose one of them (if the picklist is selected, the text field may not include text), but I still need to make sure that one of them is required. Is it possible to do this with single validation rule?

 

This is the current validation rule

AND(
NOT(ISBLANK(TEXT(picklist__c ))),
NOT(ISBLANK(Text_Field__c)))

 

Regards,

TP

Best Answer chosen by Admin (Salesforce Developers) 
Navatar_DbSupNavatar_DbSup

Hi,


Use this validation rule to meet your requirement:


if((ISBLANK(TEXT( picklist__c ))),ISBLANK( Text_Field__c ),false) || AND(
NOT(ISBLANK(TEXT( picklist__c ))),
NOT(ISBLANK( Text_Field__c )))

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

All Answers

Navatar_DbSupNavatar_DbSup

Hi,


Use this validation rule to meet your requirement:


if((ISBLANK(TEXT( picklist__c ))),ISBLANK( Text_Field__c ),false) || AND(
NOT(ISBLANK(TEXT( picklist__c ))),
NOT(ISBLANK( Text_Field__c )))

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

This was selected as the best answer
TigerPowerTigerPower

Thanks a lot S Jain! This is the solution for me. :smileyhappy:

 

Regards,

TP