You need to sign in to do that
Don't have an account?
Christian Belko 12
Assessment not confirming Validation Rule
I'm on the final part of the Formulas & Validations Badge, and have confirmed that my validation rule is working correctly. When I test my validation formula for the assignment, it works fine. Here's the rule I'm using.
AND(
NOT(ISBLANK(AccountId)),
MailingPostalCode <> Account.ShippingPostalCode
)
The assignment is to create 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. It also should apply to contact records with an associated account. Contact records with no associated parent account can be added with any MailingPostalCode value.
I believe this is setup as needed, but the error its throwing is my validation rule saying that an insert failed because of the rule? Any ideas on how to fix this?
AND(
NOT(ISBLANK(AccountId)),
MailingPostalCode <> Account.ShippingPostalCode
)
The assignment is to create 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. It also should apply to contact records with an associated account. Contact records with no associated parent account can be added with any MailingPostalCode value.
I believe this is setup as needed, but the error its throwing is my validation rule saying that an insert failed because of the rule? Any ideas on how to fix this?
and the address should match the account shipping address?
keep in mind that validation rules work the other way arround. when the result is true, they give an error.
so i think the validation rule should be:
ISBLANK(AccountId) && MailingPostalCode <> Account.ShippingPostalCode
The validation looks fine and CANNOT cause the insert to fail, it can prevent the insert action but CANNOT cause it to fail.
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
The validation is good. If you're doing the below scenario, the validation is expected to fire.
1. You're creating a new contact record (insert) and you populate the account lookup field wherein it matches the mailing postal code of the contact
2. You're referencing a different Account Lookup on Contact, maybe a custom lookup field