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
Koti P 6Koti P 6 

Superbadge Process Automation Specialist: Challenge 2

Hi Friends,

iam trying to complete the 'Process Automation Specialist Superbadge- Challenge2:  getting the following error:

Challenge Not yet complete... here's what's wrong: 
A validation rule did not prevent a new Account from being saved when Billing Country is blank and Billing State has three characters.

here are my Validation Rule code details
---------------
OR(
    AND(
         LEN(BillingState)>2,
         CONTAINS("AL:AK:AZ:AR:CA:CO:CT:DE:DC:FL:GA:HI:ID:" &
                  "IL:IN:IA:KS:KY:LA:ME:MD:MA:MI:MN:MS:MO:MT:NE:NV:NH:" &
                  "NJ:NM:NY:NC:ND:OH:OK:OR:PA:RI:SC:SD:TN:TX:UT:VT:VA:" &
                  "WA:WV:WI:WY:PR",BillingState)
      ),
      NOT(OR
       (  BillingCountry="USA",
         BillingCountry="US",
         BillingCountry="United States",
         ISBLANK(BillingCountry)
      ))
    )
-------------------------
ShippingAddressValidation

OR(
   AND (
         LEN(ShippingState)>2,
         NOT (
         CONTAINS("AL:AK:AZ:AR:CA:CO:CT:DE:DC:FL:GA:HI:ID:" &
                  "IL:IN:IA:KS:KY:LA:ME:MD:MA:MI:MN:MS:MO:MT:NE:NV:NH:" &
                  "NJ:NM:NY:NC:ND:OH:OK:OR:PA:RI:SC:SD:TN:TX:UT:VT:VA:" &
                  "WA:WV:WI:WY:PR", ShippingState))),
    NOT(OR(
        ShippingCountry="US",
        ShippingCountry="USA",
        ShippingCountry="United States",
        ISBLANK(ShippingCountry)
        )
      )
 )
-------------------
 
Best Answer chosen by Koti P 6
Raj VakatiRaj Vakati
Try this

Refer this link 

http://getawayposts.com/process-automation-specialist-superbadge-challenge-2
 
OR( 
AND( 
LEN(BillingState) > 2, 
NOT(CONTAINS(“AL:AK:AZ:AR:CA:CO:CT:DE:DC:FL:GA:HI:ID:IL:IN:IA:KS:KY:LA:ME:MD:MA:MI:MN:MS:MO:MT:NE:NV:NH:NJ:NM:NY:NC:ND:OH:OK:OR:PA:RI:SC:SD:TN:TX:UT:VT:VA:WA:WV:WI:WY”, BillingState )) 
), 
AND( 
LEN(ShippingState) > 2, NOT(CONTAINS(“AL:AK:AZ:AR:CA:CO:CT:DE:DC:FL:GA:HI:ID:IL:IN:IA:KS:KY:LA:ME:MD:MA:MI:MN:MS:MO:MT:NE:NV:NH:NJ:NM:NY:NC:ND:OH:OK:OR:PA:RI:SC:SD:TN:TX:UT:VT:VA:WA:WV:WI:WY”, ShippingState)) 
), 
NOT(OR(BillingCountry =”US”,BillingCountry =”USA”,BillingCountry =”United States”, ISBLANK(BillingCountry))), 
NOT(OR(ShippingCountry =”US”,ShippingCountry =”USA”,ShippingCountry =”United States”, ISBLANK(ShippingCountry))) 
)

 

All Answers

Raj VakatiRaj Vakati
Try this

Refer this link 

http://getawayposts.com/process-automation-specialist-superbadge-challenge-2
 
OR( 
AND( 
LEN(BillingState) > 2, 
NOT(CONTAINS(“AL:AK:AZ:AR:CA:CO:CT:DE:DC:FL:GA:HI:ID:IL:IN:IA:KS:KY:LA:ME:MD:MA:MI:MN:MS:MO:MT:NE:NV:NH:NJ:NM:NY:NC:ND:OH:OK:OR:PA:RI:SC:SD:TN:TX:UT:VT:VA:WA:WV:WI:WY”, BillingState )) 
), 
AND( 
LEN(ShippingState) > 2, NOT(CONTAINS(“AL:AK:AZ:AR:CA:CO:CT:DE:DC:FL:GA:HI:ID:IL:IN:IA:KS:KY:LA:ME:MD:MA:MI:MN:MS:MO:MT:NE:NV:NH:NJ:NM:NY:NC:ND:OH:OK:OR:PA:RI:SC:SD:TN:TX:UT:VT:VA:WA:WV:WI:WY”, ShippingState)) 
), 
NOT(OR(BillingCountry =”US”,BillingCountry =”USA”,BillingCountry =”United States”, ISBLANK(BillingCountry))), 
NOT(OR(ShippingCountry =”US”,ShippingCountry =”USA”,ShippingCountry =”United States”, ISBLANK(ShippingCountry))) 
)

 
This was selected as the best answer
Koti P 6Koti P 6
Hi Raj,

it's worked,but not able to figure it our what is wrong in my validation Qry.
Regards,
Kotit
Neeru Nagpal 10Neeru Nagpal 10
Hi Raj,

I have trying adding the above validation rule but still getting error,

User-added image

Will you please help me here?
thanks
neeru
Rahmses BaksRahmses Baks
What about this one, this worked for me, quite monkeyproof on the state

And(
OR(ShippingCountry = "US",
ShippingCountry = "USA",
ShippingCountry = "United States",
ShippingCountry = ""),
(LEN(ShippingState) != 2))