You need to sign in to do that
Don't have an account?
Nancy Engel 2
Issue with the Validation Rule Trailhead module
Here is my version of the Trailhead Valication Rule:
AND (
NOT (ISBLANK( AccountId )),
MailingPostalCode <> Account.ShippingPostalCode )
I tried it out and it works fine (checked syntax and also tried to create a contact with a different zip than the account and got the error, corrected the zip and the contact was saved). But I get this error in Trailhead.
"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, Contacts associated with an Account must have the same Mailing Postal Code as the Account Shipping Postal Code: [MailingPostalCode]"
Am I blind and missing something?????
AND (
NOT (ISBLANK( AccountId )),
MailingPostalCode <> Account.ShippingPostalCode )
I tried it out and it works fine (checked syntax and also tried to create a contact with a different zip than the account and got the error, corrected the zip and the contact was saved). But I get this error in Trailhead.
"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, Contacts associated with an Account must have the same Mailing Postal Code as the Account Shipping Postal Code: [MailingPostalCode]"
Am I blind and missing something?????
You can continue to use the current credentials to login to Trailhead and track your points/badges (so that you don't lose anything that you've already completed). Just login to a fresh new DE Org to attempt the acutal challenges. Hope this helps.
Sandeep Bhanot
Salesforce.com
All Answers
IF( AND(!ISBLANK( AccountId), MailingPostalCode != Account.ShippingPostalCode ), true, false)
try this
If its useful make best answer
Shaijan Thomas
You can continue to use the current credentials to login to Trailhead and track your points/badges (so that you don't lose anything that you've already completed). Just login to a fresh new DE Org to attempt the acutal challenges. Hope this helps.
Sandeep Bhanot
Salesforce.com
the if() is completely unnecessary. the if() is basically testing a condition, and when the condition is true, it returns true. It would be much cleaner to return the result the condtion itself, i.e., the validation rule would simply be:
AND(!ISBLANK( AccountId), MailingPostalCode != Account.ShippingPostalCode )