You need to sign in to do that
Don't have an account?
Matt Low 2
Challenge - Formulas & Validations/Creating Validation Rules
Hello - I'm working on the challenge for Creating Validation Rules and when I check my challenge, I'm getting a message, "Challenge not yet complete... here's what's wrong: The validation rule failed to enforce the business logic". I can actually see that my validation rule message is being applied when I'm in an account and trying to create a related contact with a Mailing Postal Code different from the account's Shipping Postal Code. I can also successfully create a contact with no associated parent. I've attached a screenshot of the message generated as a result of my validation rule being applied. Does Trailhead ever report a failed challenge, even though it was developed correctly? Thanks in advance.
Matt
Matt
You can use below Formula as well.
AND(
NOT( ISBLANK( AccountId ) ),
Account.ShippingPostalCode <> MailingPostalCode
)
Hope this helps too.
All Answers
Can you please post your Validation Rule's Error Condition Formula ?
This is how mine looks like and it worked.
Please let me know if this helped.
Thanks.
Matt
You can use below Formula as well.
AND(
NOT( ISBLANK( AccountId ) ),
Account.ShippingPostalCode <> MailingPostalCode
)
Hope this helps too.
'Account.ShippingPostalCode' and 'MailingPostalCode' versus the API names ('MailingPostalCode__c' and 'Account.ShippingPostalCode__c'). I don't really see how that works since my label names have spaces (e.g. 'Mailing Postal Code'). Underneath, how does it know what 'MailingPostalCode' is? Thanks again.
Error:
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, Contact must be in Account ZIP Code: [MailingPostalCode]
Formula:
OR((MailingPostalCode <> Account.ShippingPostalCode ) ,(NOT(ISBLANK(AccountId ))))
I ave tried te above formla also didnt work
Trail: Formulas and Validations --> Create Validation Rules
Error: Field MailingPostalCode does not exist. Check spelling.
Solution: Instead of writing MailingPostalCode try writing BillingPostalCode