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
Philip Young 1Philip Young 1 

validation rules challenge

I'm also having trouble with this challenge. With the logic below I get the error "The validation rule failed to enforce the business logic". But when I leave out the NOT (ISBLANK( checks for MailingPostalCode or Account.ShippingPostalCode I get a worse error "FIELD_CUSTOM_VALIDATION_EXCEPTION". Here's what my rule looks like:

User-added image
venkat-Dvenkat-D
Check if there is some other validation rule that is failing .
Parker EdelmannParker Edelmann
Try this. NOT( ISBLANK( Account.Name ) ) && MailingPostalCode <> Account.ShippingPostalCode
Phillip FrontPhillip Front
I've been having the same issues with this challenge, and I've been unable to complete it. I'm pretty sure it's a bug on Salesforce's part. Would love to hear if anyone is able to figure this out.
Philip Young 1Philip Young 1
I have no other validation rules and, as I mentioned, without the ISBLANK checks I get a worse error “"FIELD_CUSTOM_VALIDATION_EXCEPTION".
Philip Young 1Philip Young 1
In looking through the forum I saw that other people have used Account.Name unsuccessfully. But I tried it anyway and got the same “business logic” error.
Philip Young 1Philip Young 1
The two inequality operators are interchangeable but I tried the open/close angle brackets anyway: same “business logic” error.
Parker EdelmannParker Edelmann
Back when I did the unit the formula I gave worked, I'm surprised I kept it. I can't even connect my org to trailhead right now to verify it still worked. I'm pretty sure that salesforce is having some form of issues. @Phillip Front, I gave you a like because I tend to agree with you.
Parker EdelmannParker Edelmann
I just signed into my account for developer.salesforce.com, and when I went to see if I could retake the challenge, I launched my Dev org and was required to log in again to access it. When I hit check challenge it gave me this error immediately: "Your DE Org session has timed out. Please login to your DE Org to continue." Something definately is not working on salesforce's side. I've never gotten that error except when I walked away for a long time and came back to blazing trails. If I try again to log in, I get the same error message.
Philip Young 1Philip Young 1
I still don't see what I'm doing wrong and none of the suggestions has worked so I'll report this to Salesforce Support and see if I get an answer (which I'll post).
Parker EdelmannParker Edelmann
Good idea. I'm getting a little frazzled on this too. I can't even get it to connect to mine long enough to check the challenge. On every unit it tells me that my session timed out right after I logged in. I can answer questions, but no projects or other challenges.
Philip Young 1Philip Young 1
Resolution: Salesforce support recommended that I create a second Developer account and then re-test this Challenge. I did create a second account, tried the challenge, and found that it worked the first time. My first Developer account included the Nonprofit Starter Pack. I will do all future challenges in my vanilla second account.
Parker EdelmannParker Edelmann
Cool, glad that worked for you. Just make sure to mark a best answer.

Thanks,
Parker
ryan woods 8ryan woods 8
Can anyone help me get past this trail I've done everything possible and I'm still gettng this error Challenge Not yet complete... here's what's wrong: 
The validation rule failed to enforce the business logic
Parker EdelmannParker Edelmann
I finally did get it my Developer Org to connect, and NOT( ISBLANK( Account.Name ) ) && MailingPostalCode <> Account.ShippingPostalCode passed the test. It didn't at first though because the rule was inactive. Let me know if this does the trick, or if you run into further complications.

Thanks,
Parker
ryan woods 8ryan woods 8
I Finally got it to work! Paste Code as follow: NOT(ISBLANK(AccountId)) && Account.ShippingPostalCode != MailingPostalCode
Hint Hint make sure you click ACTIVE!
Parker EdelmannParker Edelmann
Yeah, it is a little helpful to have it active. Glad it worked.
Shellie RisleyShellie Risley
This code worked for me too - Thank you Parker!