0

On the Lead object, I am trying to validate that my custom "Zip_Code__c" field and the standard "Email" field contain a value in this validation rule, but despite the validation rule being active, it's not catching that the email field on the lead record is blank when I submit the record and it saves the record anyways.

Here is my validation rule.

AND( 

  $RecordType.DeveloperName = "Potential Customer", 
  ISPICKVAL(Status, "Prospective Customer"), 
  ISBLANK(Zip_Code__c), 
  ISBLANK(Email)

)
  • 3
    It is not working as desired because you have used AND operator. It will throw error only when both the Zip Code and Email fields are blank. If any one of them is populated, the formula will evaluate to false and the error will not be thrown. – Ayush Goyal Jul 16 at 6:27
0

First problem for sure : you need to use OR condition in order to check if Zip_Code__c is empty or Email is empty. I think a second problem is your Record TYpe DeveloperName because developername is the technical name and normally "space" character is not allowed.

So try a validation rule something like that (or if it doesn't work check the recordtype developer name in your setup and also maybe the Status API Name) :

AND( 
  RecordType.DeveloperName = "Potential_Customer", 
  ISPICKVAL(Status, "Prospective Customer"), 
  OR(ISBLANK(Zip_Code__c), 
  ISBLANK(Email))
)

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.