You need to sign in to do that
Don't have an account?
Dmitry Dubnovitsky
Create a validation rule to check that a contact is in the zip code of its account
I am working in https://developer.salesforce.com/trailhead/point_click_business_logic/validation_rules.I have following message in validate rule:"Challenge Not yet complete... here's what's wrong:
The validation rule failed to enforce the business logic"
My examples:
1.NOT(ISBLANK(AccountId)) && Account.ShippingPostalCode != MailingPostalCode
2.AND( NOT(ISBLANK(AccountId)),
MailingPostalCode != Account.ShippingPostalCode
)
3.AND( NOT(ISBLANK(AccountId)),
MailingPostalCode <> Account.ShippingPostalCode
)
Help me please solve this problem!
The validation rule failed to enforce the business logic"
My examples:
1.NOT(ISBLANK(AccountId)) && Account.ShippingPostalCode != MailingPostalCode
2.AND( NOT(ISBLANK(AccountId)),
MailingPostalCode != Account.ShippingPostalCode
)
3.AND( NOT(ISBLANK(AccountId)),
MailingPostalCode <> Account.ShippingPostalCode
)
Help me please solve this problem!
2.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): NOT(ISBLANK(AccountId))
You should create a validation rule on contact, not a workflow rule. Please find the screenshot below.
Hope this helps.
Inactivate / delete the workflow rule you have created, delete the validation rule and create the validation rule again from scratch. Make sure to use the naming convention as given in the trailhead challenge.
Check if that helps.
Contact -> validation rules.
Did you get your problem solved? I put in the same rule and it gets saved without any syntax error and even it worked when I tried creating a contact with different ZIP code than its account ZIP. But in the Challenge it shows me "The validation rule failed to enforce the business logic" error!
Anyone else faced this problem and solved it? Help!
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, A contact with a MailingPostalCode that has an account and does not match: []
Request for suggestions to overcome the above issue.
Hi Friends,
Use Create the Validation Rule in the Contact Field Steps to create validation rules for the above requirement is
1) Setup | Bulid | Customize | Contacts | Fileds | Select Account Name | Click on Validation Rule | New.
2) Then Enter the Details
Rule Name:Contact must be in Account ZIP Code.
In Error Condition Formula: AND( NOT(ISBLANK(AccountId)),
MailingPostalCode <> Account.ShippingPostalCode
)
Error Message : Enter the error as per the requirement.
Error Location :Select the error location from the drop down menu Mailing Zip/Postal Code.
3)Now Click Save & Now Go & check in the traihead challage to check its working fine or not, Click check challenege.
Thanks
Muqeet