You need to sign in to do that
Don't have an account?
Error on Trailhead when checking 'Creating Validation Rules' challenge
Hi All- as part of the challenge on the 'Creating Validation Rules' module, I created the following Validation Rule on the Contact Object, and confirmed that it indeed is working by creating a few test records.
However when clicking the 'Check Challenge' button, I get the following error. Any ideas on how to resolve?
Validation Rule:
However when clicking the 'Check Challenge' button, I get the following error. Any ideas on how to resolve?
Validation Rule:
AND ( NOT(ISBLANK(MailingPostalCode)), NOT(MailingPostalCode = Account.ShippingPostalCode) )Error:
Challenge Not yet complete... here's what's wrong: There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Zip Code must match that of the Account. Please correct and save.: [MailingPostalCode]Thank you in advance for any assistance!
Requirement:
The validation rule should ONLY apply to contact records with an associated account. Contact records with no associated parent account can be added with any MailingPostalCode value. (Hint: you can use the ISBLANK function for this check)
Full Logic:
AND(
NoT(ISBLANK(AccountId)),
MailingPostalCode !=Account.ShippingPostalCode)
As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Thanks
All Answers
Requirement:
The validation rule should ONLY apply to contact records with an associated account. Contact records with no associated parent account can be added with any MailingPostalCode value. (Hint: you can use the ISBLANK function for this check)
Full Logic:
AND(
NoT(ISBLANK(AccountId)),
MailingPostalCode !=Account.ShippingPostalCode)
As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Thanks
My rule :
AND(
ISBLANK(Account.Name), // this was incorrect as the challenge was to check if the Account field on a contact is "NOT" blank or not associated //to an account
MailingPostalCode =Account.ShippingPostalCode) // instead of the "!=" i was using "="