Validation rule if Picklist Value is Yes, text required. - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Ethan SeagravesEthan Seagraves 

Validation rule if Picklist Value is Yes, text required.

I have a validation rule where if Stage is going to be set to 8: Pricing Approved, and In_House is "Yes", then "Codes" are required. 

Stage is a picklist, In House is a picklist, Codes is a text field.

My validation rules won't fire, no matter how I write them. I've tried the following.

IF (ISPICKVAL ( Stage__c, "8: Pricing Approved"),
AND ((ISPICKVAL ( In_House__c , "Yes")),
(ISBLANK(Codes__c)))

as well as 

AND
ISPICKVAL (Stage__c,"8: Pricing Approved")
AND(
ISPICKVAL(In_House__c,"Yes"),
ISBLANK(Codes__c)
)

Nothing has worked so far. I'm pulling my hair out. 
Best Answer chosen by Ethan Seagraves
Christine MarshallChristine Marshall
AND(
ISPICKVAL( Stage__c, "8: Pricing Approved"),
ISPICKVAL( In_House__c , "Yes"),
ISBLANK(Codes__c)
)

I don't think you need the IF. 

All Answers

Christine MarshallChristine Marshall
AND(
ISPICKVAL( Stage__c, "8: Pricing Approved"),
ISPICKVAL( In_House__c , "Yes"),
ISBLANK(Codes__c)
)

I don't think you need the IF. 
This was selected as the best answer
adam marksadam marks
To dovetail on what Christine said I would suggest adding an IsChanged condition to make sure it only fires when the Stage__c field is changed. Otherwise it will evaluate based on any update to the record and you will get false positives. 

Your syntax looks ok to me. Can you confirm that you have your text literal argument for the picklist correct? To say it another way if the list value is "8:Pricing" but you entered "8: Pricing" it wont trigger. 
Ethan SeagravesEthan Seagraves
@Adam and Christine

All good points, and as it turns out, totally unnecessary. There is an API name that is in fact "In_House__c". However in this case, that was not the right In House field. 

Check your API Names people. When I replaced the API name, it worked. 
Christine MarshallChristine Marshall
@Ethan this made me smile! Glad you got it sorted :) 
Ethan SeagravesEthan Seagraves
@Christine, thank you! And thanks for saying "got it sorted". I'm American and that's the British phrase I use most often.