Ask Search:
Benjamin MarloweBenjamin Marlowe 

NOT ISBLANK(AccountId)&&(MailingPostalCode<>Account.ShippingPostalCode)

I am trying to pass a Challenge about Validation Rules. 

My code (with the help of the community) looks like this: NOT ISBLANK(AccountId)&&(MailingPostalCode<>Account.ShippingPostalCode)

The Error I am getting is System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Contact not associated with Shipping Postal Code: [MailingPostalCode]

I have looked through the "Best Answers" and this should have fixed the problem but I am still stuck where others have been able to use this code to help with this Error. Is there something else I am missing that's bogging this down?
Best Answer chosen by Benjamin Marlowe
Shubham BhardwajShubham Bhardwaj
Hi, Benajmin You formula having a very little mistake as you left the Brackets.
NOT( ISBLANK(AccountId)) && (MailingPostalCode<>Account.ShippingPostalCode)

And there is another method of writing your formula which Adam Johnson explained above.


Let us know if it helps you and mark it best if it helps you
Thanks, 
Shubham Bhardwaj
For more Connect with me on twitter @shubham_sfdc 


 

All Answers

Adam JohnsonAdam Johnson
AND(
NOT(ISBLANK(AccountId)),
MailingPostalCode <> Account.ShippingPostalCode
)
Shubham BhardwajShubham Bhardwaj
Hi, Benajmin You formula having a very little mistake as you left the Brackets.
NOT( ISBLANK(AccountId)) && (MailingPostalCode<>Account.ShippingPostalCode)

And there is another method of writing your formula which Adam Johnson explained above.


Let us know if it helps you and mark it best if it helps you
Thanks, 
Shubham Bhardwaj
For more Connect with me on twitter @shubham_sfdc 


 
This was selected as the best answer
Benjamin MarloweBenjamin Marlowe
I greatly appreciate it! That seemed to do the trick. Thanks for your recommendation. Ben Marlowe Account Support Executive Office - 866.885.3249 ext. 963 [cid:image002.jpg@01D5019B.56472740] 2071 Broughton St. Carmel, IN Click here to visit us Online!
Shubham BhardwajShubham Bhardwaj
Benjamin, Please close the thread As if the error is Solved Now. By marking it the Best Answer
Thankyou.