You need to sign in to do that
Don't have an account?
Rajan
Challenge Not yet complete... here's what's wrong: The validation rule failed to enforce the business logic
Hi Guyz,
Trailhead requirement for validation:
*************************************************
Create a validation rule to check that a contact is in the zip code of its account.
To complete this challenge, add a validation rule which will block the saving of a new or updated 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 saved
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)
Every time I'm getting the same error as --- Challenge Not yet complete... here's what's wrong:
The validation rule failed to enforce the business logic
My validation formaula is :
1) AND( NOT( ISBLANK( AccountId ) ), MailingPostalCode <> Account.ShippingPostalCode )
2) AND( NOT(ISBLANK( Account.Id)), MailingPostalCode <> Account.ShippingPostalCode )
3) IF(ISBLANK( Account.Id ), false, (IF(MailingPostalCode <> Account.ShippingPostalCode, true, false)))
4) AND( NOT( ISBLANK( AccountId ) ), MailingPostalCode__c <> Account.ShippingPostalCode )
My challengfe is not passing in for any case but its firing from frontend.
Trailhead requirement for validation:
*************************************************
Create a validation rule to check that a contact is in the zip code of its account.
To complete this challenge, add a validation rule which will block the saving of a new or updated 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 saved
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)
Every time I'm getting the same error as --- Challenge Not yet complete... here's what's wrong:
The validation rule failed to enforce the business logic
My validation formaula is :
1) AND( NOT( ISBLANK( AccountId ) ), MailingPostalCode <> Account.ShippingPostalCode )
2) AND( NOT(ISBLANK( Account.Id)), MailingPostalCode <> Account.ShippingPostalCode )
3) IF(ISBLANK( Account.Id ), false, (IF(MailingPostalCode <> Account.ShippingPostalCode, true, false)))
4) AND( NOT( ISBLANK( AccountId ) ), MailingPostalCode__c <> Account.ShippingPostalCode )
My challengfe is not passing in for any case but its firing from frontend.
Follow below steps.
Go To Setup-
Customize-
Contact-
Validation Rules-
Rule name- Contact must be in Account ZIP Code-
Formula-
AND(NOT(ISBLANK(AccountId)) ,MailingPostalCode <> Account.ShippingpostalCode)
Error Message- Zip Codes do not match-
Save
and then check your challenge.
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
Best Regards
Sandhya
Your 4th validation rule is correct check for your rule name and error message.
I've checked and all conditions are correct. I think their is some issue with Trailhead for this.
can you please share your challenge trailhead link?
After few un successfull attempt I got it cleared with the below formula-
AND(
NOT(ISBLANK( AccountId )),
(MailingPostalCode <> Account.ShippingPostalCode )
)
Thank you,
LAlit