Ask Search:
Adam LoepfeAdam Loepfe 

Lead Validation Rule Question

I want to have a validation error occur when someone switches the Lead Status to "Requesting Validation" but where there are no Validation Requests behind the lead (False).  My current validation rule formula is the following.  How do I get this to throw and error to the user when they select the Lead status of "Requesting Validation" but the Validation Request is set to False?  Thanks for your help!

AND( 
OR( 
TEXT( Status ) = "Requesting Validation"
), 
Validation_Request__r.Name = "False"
)

Error Message: The Lead Status will move to "Requesting Validation" automatically when the Request Validation button is selected and the Request Validation form is filled out.
Best Answer chosen by Adam Loepfe
Mayank SrivastavaMayank Srivastava
Adam, are you looking for something like this?
AND( 
    TEXT( Status ) = "Requesting Validation" , 
    Validation_Request__r.Name = "False"
)

If that doesn't work, 
  • What is this Validation Request? A separate object? A field?
  • Are you trying to check for a False checkbox or the name field on related object = "False"?

All Answers

Mayank SrivastavaMayank Srivastava
Adam, are you looking for something like this?
AND( 
    TEXT( Status ) = "Requesting Validation" , 
    Validation_Request__r.Name = "False"
)

If that doesn't work, 
  • What is this Validation Request? A separate object? A field?
  • Are you trying to check for a False checkbox or the name field on related object = "False"?
This was selected as the best answer
Pritam ShekhawatPritam Shekhawat
Try this.
AND( 
TEXT( Status ) = "Requesting Validation",
Validation_Request__r.Name = "False"
)
Adam LoepfeAdam Loepfe
Unfortunatley I tried this and it isn't working. 
The Validation Request is a separate object but the Validation_Request__r.Name field is a formula field that returns "True" if there are one or more Validation Request assocaited with that lead, otherwise it will return "False".
I am trying to say that if there are no Valdiation Requests ("False") do not allow someone to switch this field.
Mayank SrivastavaMayank Srivastava
Can you post a screenshot of the Lead record showing the Status field and the Validation Request field displaying a 'False' value?
Adam LoepfeAdam Loepfe
There is something weird with that Valdiation Name formula because it will work if I pull in where any field on the Validation Request object is null.
Here is a screenshot
User-added image
Adam LoepfeAdam Loepfe
Thanks Guys, 
Got it figured out.  API name was wrong.  You did help with the validation rule of just AND though.  Thanks!