You need to sign in to do that
Don't have an account?
Rajan
Trailhead Validation rule to check that a contact is in the zip code of its account.
Challenge is as below:--
To complete this challenge, add a validation rule which will block the insertion of a contact if the contact is related to an account and has a mailing postal code (which has the API Name MailingPostalCode) different from the account's shipping postal code (which has the API Name ShippingPostalCode).
Name the validation rule 'Contact must be in Account ZIP Code'.
A contact with a MailingPostalCode that has an account and does not match the associated Account ShippingPostalCode should return with a validation error and not be inserted.
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)
--------------------------------------------
My validation rule is as attached picture
And Error is- Challenge Not yet complete... here's what's wrong:
The validation rule failed to enforce the business logic
To complete this challenge, add a validation rule which will block the insertion of a contact if the contact is related to an account and has a mailing postal code (which has the API Name MailingPostalCode) different from the account's shipping postal code (which has the API Name ShippingPostalCode).
Name the validation rule 'Contact must be in Account ZIP Code'.
A contact with a MailingPostalCode that has an account and does not match the associated Account ShippingPostalCode should return with a validation error and not be inserted.
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)
--------------------------------------------
My validation rule is as attached picture
And Error is- Challenge Not yet complete... here's what's wrong:
The validation rule failed to enforce the business logic
Try this-
Thanks
Rupal kumar
I tried yours also but same error. My Condition formula is:_
AND(NOT( ISBLANK(AccountId) ),MailingPostalCode <> Account.ShippingPostalCode)
Error- Challenge Not yet complete... here's what's wrong:
The validation rule failed to enforce the business logic
AND(NOT( ISBLANK( Account.Name) ),MailingPostalCode <> Account.ShippingPostalCode)
Thanks,
Try this---
AND(
NOT(ISBLANK( AccountId )),
(MailingPostalCode <> Account.ShippingPostalCode )
)
AND (
NOT(ISBLANK( Account.Name )),
MailingPostalCode !=Account.ShippingPostalCode)
You can use the below one.
AND(
NOT( ISBLANK( AccountId ) ),
MailingPostalCode != Account.ShippingPostalCode
)
If you find your Solution then mark this as the best answer.
Thank you!
Regards
Suraj Tripathi