You need to sign in to do that
Don't have an account?
TrailHead Challenge is not working correclty
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)
for the above challenge I used following validation rule and its working
IF( AND(NOT( ISBLANK( MailingPostalCode__c)), NOT(ISBLANK( AccountId )) ), IF( (NOT(MailingPostalCode__c = Account.ShippingPostalCode__c)), true, false) , false)
But when I click on check challenge giving Error anybody can can help me on this.
Error Message "Challenge not yet complete... here's what's wrong: The validation rule failed to enforce the business logic"
Thanks
Shaijan
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)
for the above challenge I used following validation rule and its working
IF( AND(NOT( ISBLANK( MailingPostalCode__c)), NOT(ISBLANK( AccountId )) ), IF( (NOT(MailingPostalCode__c = Account.ShippingPostalCode__c)), true, false) , false)
But when I click on check challenge giving Error anybody can can help me on this.
Error Message "Challenge not yet complete... here's what's wrong: The validation rule failed to enforce the business logic"
Thanks
Shaijan
Hope this make sense to all.
All Answers
IF (!ISBLANK( AccountId ) && ( MailingPostalCode <> Account.ShippingPostalCode ),true,false)
Thanks
Shaijan
I created it based on above challenge. I create 2 custom text field on Contact (MailingPostalCode__c ) and Account (ShippingPostalCode__c). I created the validation Rule 'Contact_must_be_in_Account_ZIP_Code'. Functionality is working fine with the validation. But when I click on TrailHead check challenge button its giving error.
Thanks
Shaijan Thomas
Shaijan
Hope this make sense to all.
I thought its custom field, Works fine now
Shiajan
Did you stop receiving the error. I am using the same code as yours and functionality wise its fine but still getting the same error.