Need a little help with creating a validation rule - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Corey BellCorey Bell 

Need a little help with creating a validation rule

Hello,

I am new to validation rules, and need some help.  I'm trying to prevent saving a record if the stage is prospecting and the Rank picklist field is blank.  This is also record type specific.
Best Answer chosen by Corey Bell
Tony TrinhTony Trinh
Hi Corey,

Try this out!
AND(
ISPICKVAL(StageName, "Prospecting"),
RecordType.Name = "Name of Record Type",
ISBLANK(TEXT(Rank__c))
)

All Answers

Tony TrinhTony Trinh
Hi Corey,

Try this out!
AND(
ISPICKVAL(StageName, "Prospecting"),
RecordType.Name = "Name of Record Type",
ISBLANK(TEXT(Rank__c))
)
This was selected as the best answer
Moustafa IshakMoustafa Ishak
Can you try this 
And(text(stagename='prospecting'),text(rank__c)='')

 
Corey BellCorey Bell
Hi Tony, this still allowed me to save without a value in the field.
Tony TrinhTony Trinh
Please check the name of the your record type is exact in the quotes. This includes spacing and case-sensitivity. Same goes with your Stage name in the quotes.
Corey BellCorey Bell
Thanks Tony! When looking at the record type, I was using "Record Type Name" in the rule, but should have been using the "Record Type Label". Thanks for the help.