function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Michael GrossmannMichael Grossmann 

Stuck on Trailhead Challenge for Unit 3/3 Validation Formulas

This Trailhead issue seems to have frustrated half a generation of Salesforcers. This should be pretty straightforward but the syntax checker does not allow "MailingPostalCode" for the good reason that it is nowhere to be found in the insertable fields. I can insert a billing postal code to get passed the syntax checked, but then I fail the challenge. Is the issue with the instructions, or is my Account object actually missing a MailingPostalCode ?
User-added image
charchit nirayanwalcharchit nirayanwal
use the insert field button to type field name !!
AnkaiahAnkaiah (Salesforce Developers) 
Hi Michael,

You need to write a validation rule on Contact object.

formula:
AND ( 
 

NOT (ISBLANK ( AccountId )), 
 

MailingPostalCode <> Account.ShippingPostalCode 
 

)

If this helps, Please mark it as best answer.

Regards,
Ankaiah
Michael GrossmannMichael Grossmann
I used only Insert field and Insert operator buttons.
Also of note, when I do so for Account > Id, what appears is Id and not AccountId as in your examples. Maybe different versions of Lightning are running on our playgrounds. Likewise, ShippingPostalCode is inserted as such, not as Account.ShippingPostalCode.
Michael GrossmannMichael Grossmann
The problem is that MailingPostalCode does not appear in my list of choices under Account (or anywhere else). If I type it in, I cannot get past the syntax checker. Of course, if I write BillingPostalCode, the code is authorized but it fails the challenge.
Suraj Tripathi 47Suraj Tripathi 47
Hi  Michael Grossmann,
 
Please apply this syntax for the same hope it works.

AND (NOT(ISBLANK ( AccountId)) , MailingPostalCode <> Account.ShippingPostalCode)
User-added image

If this helps, please mark it as the best answer.

Thanks and Regards,
Suraj

 
Michael GrossmannMichael Grossmann
Thank you Suraj. My issue is solved. The problem was that I was attempting to add a rule on the ‘Account’ object instead of the ‘Contact’ object.