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
markoulakismarkoulakis 

Need to make a Picklist field required when another picklist field is set to a specific value

I need to make a custom picklist field called "Type of Intro Purchase" required when the custom picklist field called "Class Complimentary? is set to "Yes-Intro Purchase".  Not sure if this can be done with a validation rule or if it needs to be a trigger.

 

Thanks!

Marie

Steve :-/Steve :-/

Here you go

AND(
TEXT(Class_Complimentary__c) = "Yes-Intro Purchase",
ISBLANK(TEXT(Type_of_Intro Purchase__c)))

 

 

PS.  You owe me a beer! ;-D

sfdcfoxsfdcfox

Depending on use case, you can also use the dynamic picklist/required combination... make a dependent picklist relationship between "Class Complimentary?" and "Type of Intro Purchase" such that no options are available unless "Yes-Intro Purchase" is selected, then make "Type of Intro Purchase" required on the layout. When you save this setup, the field will change from empty/not-required to required when that value is selected. This provides immediate visual feedback that a field is required, because the red "required" bar will appear. Without this feedback, users will save, then have to fix this "mistake" and save again. You should take advantage of this platform feature if it makes sense.

Steve :-/Steve :-/

Are you all set or do you still need help with this?