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
leluttrellleluttrell 

How to add error text to a dependant field?

I created a field that is dependent on a picklist. How do I make it required and show an error message when it is enabled but left blank? 
Best Answer chosen by leluttrell
Lokesh KumarLokesh Kumar
HI Lori,

Ohhkk !!
 
AND( ISPICKVAL(Type_of_Medical_Position__c , "Medical"), ISPICKVAL(Medical_Position__c  ,""))

Change your field name accordingly :) 

Thanks
Lokesh

All Answers

Lokesh KumarLokesh Kumar
Hi Lori,

You have to write a Validation Rule to achieve this.
 
AND( LEN(TEXT(your_1st_piclist_field)) > 0, ISPICKVAL(Dependant_Field,""))
let me know if this works for you.

-Lokesh
 
leluttrellleluttrell
Hi Lokesh. I only want it to show the error message if a specific selection is chosen in the picklist field. So for example, if Bid Defense is chosen in my picklist field, I want my dependent field to enable, then an error message to appear if that dependent field is left blank. Do you know what validation rule would work for this scenario? 
Lokesh KumarLokesh Kumar
HI Lori,

Ohhkk !!
 
AND( ISPICKVAL(Type_of_Medical_Position__c , "Medical"), ISPICKVAL(Medical_Position__c  ,""))

Change your field name accordingly :) 

Thanks
Lokesh
This was selected as the best answer
leluttrellleluttrell
That worked! Thanks for all of your help. 
Lokesh KumarLokesh Kumar
Kindly make this question solved by selecting an answer that worked for you.