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
FatemehFatemeh 

Validation Rule for choosing any value in the picklist field making a text field mandatory

Hello,

I previously created this VR and it was working fine until (at a later date) a 5th value was added to the picklist at which time I adjusted the numbers and values in the VR, but only the first picklist value was firing. 

AND( 
CASE( PICKLIST_FIELD__ c, 
"Value 1",1, 
"Value 2",2, 
"Value 3",3, 
"Value 4",4, 
"Value 5",5, 
0 ) = 1, 
ISBLANK( TEXT_FIELD__c )  
)

As a quick workaround I created five VRs, but would like to fix the above VR and remove the five VRs. Here's one of five VRs that's working:

AND( 
ISPICKVAL( PICKLIST_FIELD__ c , "Value 1") , 
ISBLANK( TEXT_FIELD__c ) 
)

I'd appreciate any guidance! Thank you in advance! :)
Best Answer chosen by Fatemeh
Abdul KhatriAbdul Khatri
Hi Fatemeh

Please use the below rule
 
AND( 
     NOT(ISBLANK (TEXT (PICKLIST_FIELD__ c))) ,
     ISBLANK( TEXT_FIELD__c ) 
)

I hope this help.

Please don't forget to mark it a best answer.

All Answers

Abdul KhatriAbdul Khatri
Hi Fatemeh

Please use the below rule
 
AND( 
     NOT(ISBLANK (TEXT (PICKLIST_FIELD__ c))) ,
     ISBLANK( TEXT_FIELD__c ) 
)

I hope this help.

Please don't forget to mark it a best answer.
This was selected as the best answer
FatemehFatemeh
Brilliant!!! Thank you Abdul! :)