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
Alex Waddell 12Alex Waddell 12 

Making a field required based off of pick list value

Hey all,

I am trying to make a field required if the values of a pick list meet certain criteria.

heres how i want it to work;

If "Visit_Type__c" equals "follow up - Home" or "Phone Call" 
then
Make "Care_Plan_Issues_Interventions_Addressed__c" Required

Below is a picture of the object. It's a simple clinical note for our business. I have the field required from the page layout right now but i would like to impliment this Validation rule.

User-added image
Alain CabonAlain Cabon
Hello,

The field "Care_Plan_Issues_Interventions_Addressed__c" in the layout must not be required by default and the validation rule prevents the saving :

If "Visit_Type__c" equals "follow up - Home" or "Phone Call" 
and  "Care_Plan_Issues_Interventions_Addressed__c" is empty.

Alain





 
Akhil AnilAkhil Anil
Hi Alex,

Your validation rule formula would be simply this
 
AND(
CASE(Visit_Type__c,
"follow up - Home",1,
"Phone Call",1,
0) = 1,
ISBLANK(Care_Plan_Issues_Interventions_Addressed__c)
)

Kindly mark it as an answer if that works !
Karthi XaviKarthi Xavi
Hello Alex,
Disable the required option in layout and create a validation rule with the following,
 AND(
   OR(
        ISPICVAL(Visit_Type__c="follow up - Home") , ISPICVAL(Visit_Type__c="Phone Call")
      ),
   ISBLANK(Care_Plan_Issues_Interventions_Addressed__c)
)
KAUSTUBH TRIPATHIKAUSTUBH TRIPATHI
Hi 
Akhil Anil,
its working for me too.