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
Mike ColegroveMike Colegrove 

validation rule in trailhead fails

Why did the following not work for the validation rule ?  It gave an error with no real explanation.

AND (
  NOT isBlank(AccountID),
   NOT CONTAINS(MailingPostalCode, Account.ShippingPostalCode)
)
 
Nikhil Verma 6Nikhil Verma 6
You need to include the brackets around NOT as well. So the formula should be:
AND (
  NOT(isBlank(AccountID)),
   NOT(CONTAINS(MailingPostalCode, Account.ShippingPostalCode))
)

Hope this helps.
Suraj TripathiSuraj Tripathi

Hi Mike,

Please try this for validation rule.

AND( 
NOT( ISBLANK( AccountId ) ), 
MailingPostalCode <> Account.ShippingPostalCode 
)


Hope it will help you.​

Regards,

Suraj