1

I am trying to put a validation rule together that fires if certain values on the picklist field Presenting_Need_of_Case__c are populated and then requires the user to populate a contact field called "DV Perpetrator / Opposing Party". The following syntax is firing when Presenting_Need_of_Case__c picklist values are selected, but once I populate the "DV Perpetrator / Opposing Party" field, it still will not allow me to save. How do I add the "DV Perpetrator / Opposing Party" criteria to allow the user to save the record after that contact is added?

CASE
(Presenting_Need_of_Case__c, 
"Legal - Divorce", 1, 
"Counseling - Domestic Violence",1, 
"Immigration - UVisa/VAWA", 1, 
"Shelter - Domestic Violence", 1, 
"Legal - Divorce", 1, 
"Legal - Order of Protection", 1, 0) = 1
3

Go ahead and give this a shot.

AND(    
CASE (
Presenting_Need_of_Case__c, 
  "Legal - Divorce", 1, 
  "Counseling - Domestic Violence",1, "Immigration - UVisa/VAWA", 1, 
  "Shelter - Domestic Violence", 1, "Legal - Divorce", 1, 
  "Legal - Order of Protection", 1, 0) = 1,
  ISBLANK(DV_Perpetrator_Opposing_Party__c))

I added some spacing just to make it look cleaner. Also, I guessed on the API name for the contact field. make sure you replace it with the actual API name for that field.

| improve this answer | |
  • How does this compile? AND requires Boolean expressions, not numbers – cropredy Jul 25 '16 at 19:07
  • That is a valid point that I didn't think of. I have update my answer. – cmmoutes13 Jul 25 '16 at 19:29
  • No, you had it right before. You compare the CASE result to 1. You can't output TRUE/FALSE from a CASE statement. – Adrian Larson Jul 25 '16 at 19:40
  • Alright, but isn't he right about AND not evaluating numbers? – cmmoutes13 Jul 25 '16 at 19:42
  • You're not evaluating numbers. You're evaluating the Boolean output of the comparison CASE(...) = 1. – Adrian Larson Jul 25 '16 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.