+ Start a Discussion
Becky ChaffeeBecky Chaffee 

Trailhead Developer creating validation rules.

Can't understand the error for this Trailhead challenge - 
Error screen shot
work that returned error
Amit Chaudhary 8Amit Chaudhary 8
Hi Becky Chaffee,

Please try below validation rule :-
AND( 
NOT(ISBLANK(AccountId)), 
MailingPostalCode != Account.ShippingPostalCode 
)
User-added image

Please mark this as solution if this will help you.

Thanks,
Amit Chaudhary
Becky ChaffeeBecky Chaffee
Doesn't != imply that it is a text question? Why wouldn't it work as a number question? My solution was just the same, but in number using
Becky ChaffeeBecky Chaffee
AND( NOT(ISBLANK( MailingPostalCode__c )), MailingPostalCode__c != ShippingPostalCode__c )
Amit Chaudhary 8Amit Chaudhary 8
I got the issue. You are using custom field (__c) but we need to use saleforce standard field only. And According to task we also need to check IsBlank for account level check also. We need to execute below formula only when Acount lookup is not blank on contact object.


AND( NOT(ISBLANK(AccountId)), MailingPostalCode != Account.ShippingPostalCode )
NOTE:- All API name also mention in task. 

Please let us know if this will help you
 
Becky ChaffeeBecky Chaffee
The auto fill fills in the API Why is this?
Amit Chaudhary 8Amit Chaudhary 8
Please check task detail and below pic. We need to use "MailingPostalCode" and "ShippingPostalCode" field.

User-added image

Please mark above as best Answer if above solution helps you and you are able to clear your challenge.

Thanks,
Amit Chaudhary
Amit Chaudhary 8Amit Chaudhary 8
Hi Becky Chaffee,

Please mark above as solution if you issue is resolved
Becky ChaffeeBecky Chaffee
I can not see the screen shots to see what the question was and if it is resolved. I have had a number of questionsk, but I have given up on getting answers from salesforce by now. becky
John LynnJohn Lynn
I know this is an old thread, but can someone please explain to me why the != was needed?  It was my missing link per say in passing this challenge, but cannot figure out why.
Merveille BalinMerveille Balin
AND( 
NOT(ISBLANK(Owner.Contact.MailingPostalCode)), 
MailingPostalCode__c != ShippingPostalCode 
)

It's working for me ..
Madhur Katarmal 5Madhur Katarmal 5

Hi

Try using the below code. Also make sure you are putting this validation rule on Contact and not Account.

 

AND( 
NOT(ISBLANK( Account.Id )), 
MailingPostalCode != Account.ShippingPostalCode 
)
SAKET  SRIVASTAVASAKET  SRIVASTAVA
Thanks for the solution. Its working!!
Becky ChaffeeBecky Chaffee
- This mail is in HTML. Some elements may be ommited in plain text. - Hello do you have an amazon account? Becky
Becky ChaffeeBecky Chaffee
- This mail is in HTML. Some elements may be ommited in plain text. - Hello do you have an amazon account? Becky
Suraj Tripathi 47Suraj Tripathi 47
Hi Becky,

You can try the below validation rule, it will help you to complete your challenge.
AND( 
NOT(ISBLANK(AccountId)), 
MailingPostalCode <> Account.ShippingPostalCode 
)

If you find your Solution then mark this as the best answer. 

Thank you!

Regards 
Suraj Tripathi