Ask Search:
Samantha PowellSamantha Powell 

Validation Rule - State Abbreviation Requirement

I modified the Valid Shipping State Validation Rule to require a two letter state abbreviation when a lead is entered. While I was able to change the rule so that a lead can be entered without a state should we not have that information, I cannot change the rule to allow for lead entry without a country. The rule is working in every respect aside from when the country field is left blank. I did include ISBLANK(Country) in the rule so I'm not sure why the logic isn't working - please help.

AND (
OR( Country = "US", Country ="USA", ISBLANK( Country )),
OR(
LEN( State ) < 2, ISBLANK( State ) ,
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", State )
)))

Thank you in advance!
Steve MolisSteve Molis
 I'm sure if if I follow what you're trying to do with your exemption.  This is a Lead US State VR that we use (we have a separate one for country = CA).  Non US/CA Leads are exempt from State/Province, however we do require ISO 3166-Alpha-2 Country Code on all Leads and Accounts.    

AND ( 
NOT( $Profile.Name = "System Administrator"), 
Country = "US", 
OR( 
LEN(State) <> 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", State) 
)))
Samantha PowellSamantha Powell
Thank you SteveMo! I guess the ISBLANK(Country) was causing all the problems.