Having issues with validation rule - Answers - Salesforce Trailblazer Community
Ask Search:
Tracy ReidTracy Reid 

Having issues with validation rule

I have a dependent picklist field that I would like to make mandatory if the controlling value is chosen. My formula is not working and I can't see what I have gotten wrong.

If lead source equals Trusted Referral, then the Referral field must be filled out. Values below in Referral are the only options available.

AND(
 ISPICKVAL ( LeadSource , 'Trusted Source(Referral)'),
 AND(
 NOT( ISPICKVAL(Referral__c, 'Partner Referral')),
 NOT( ISPICKVAL(Referral__c, 'Board Referral')),
 NOT( ISPICKVAL(Referral__c, 'Other Trusted Source Referral'))
)
)

Thank you for your help.
Best Answer chosen by Tracy Reid
Deepak AnandDeepak Anand
Have you tried making the Dependent Field Required on the Page Layout ?

This way it will be enforced only when a value is chosen in the Controlling Field(even if you see the Red Mark next to the Dependent Field with Controlling Field still empty). This will impart the best User Experience as opposed to a Validation Rule.

All Answers

Deepak AnandDeepak Anand
Have you tried making the Dependent Field Required on the Page Layout ?

This way it will be enforced only when a value is chosen in the Controlling Field(even if you see the Red Mark next to the Dependent Field with Controlling Field still empty). This will impart the best User Experience as opposed to a Validation Rule.
This was selected as the best answer
Tracy ReidTracy Reid
Thank you very much Deepak. I thought this was the route we had started with and wasn't working but it appears it is not. This is what happens when you don't finish a project before you go on holidays ;) I sincrely appreciate your help.