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
Abid ullahAbid ullah 

Error: Syntax error. Extra AND

NOT(

     OR(
   
    Country  = 'US',
    Country  = 'USA',
    Country  = 'United State of America',
     ISBLANK(Country) 

     ) 

     )  
     
 AND(
     LEN(State)= 2,
     CONTAINS(State, "AB"},
     CONTAINS(State, "CD"},
     CONTAINS(State, "EF"}
)
Best Answer chosen by Abid ullah
Maharajan CMaharajan C
Hi Abid,

Please try the below validation rule:
 
OR(
AND(
Country != 'US',
Country != 'USA',
Country != 'United State of America',
NOT(ISBLANK(Country))
),
LEN(State) <> 2,
NOT(
CONTAINS("AB:CD:EF", State)
)
)

Thanks,
Maharajan.C
​​​​​​​

All Answers

Maharajan CMaharajan C
Hi Abid,

Can you please explain the scenrio...

Why you are writing this formula...

Thanks,
Maharajan.C
Abid ullahAbid ullah
Thanks Maharajan C,
I am writing a validation rule for lead object that lead state will be only two character and character should be predefined and the country of lead will be US or USA or United state of America or blank.
Maharajan CMaharajan C
Hi Abid,

Please try the below validation rule:
 
OR(
AND(
Country != 'US',
Country != 'USA',
Country != 'United State of America',
NOT(ISBLANK(Country))
),
LEN(State) <> 2,
NOT(
CONTAINS("AB:CD:EF", State)
)
)

Thanks,
Maharajan.C
​​​​​​​
This was selected as the best answer
Abid ullahAbid ullah
Thanks,
This is working for me!
vgfdhbg gvfdhbfgvgfdhbg gvfdhbfg
I am writing a validation rule for lead object that lead country can be only two individual link (https://macclesfieldremovals.co.uk/furniture-removals-macclesfield/) and person ought to be predefined and the country of lead will be US or USA or United kingdom of America or clean.