+ Start a Discussion
syricsyric 

Validation Rule Help - Fire when fields are anything but specific values.

I have a validation rule:

AND(OR(BillingCountry = "CAN", BillingCountry = "USA"),
VLOOKUP( 
$ObjectType.Zip_Code__c.Fields.City__c , 
$ObjectType.Zip_Code__c.Fields.Name , 
BillingPostalCode) <> BillingCity)

I want it work when BillingCountry is anything besides CAN or USA.  Is there a way to do this without doing BillingCountry = "" for every other country in the world?

 

I tried this and it did not work correctly:

AND(OR(NOT(BillingCountry = "CAN"), NOT(BillingCountry = "USA")),
VLOOKUP( 
$ObjectType.Zip_Code__c.Fields.City__c , 
$ObjectType.Zip_Code__c.Fields.Name , 
BillingPostalCode) <> BillingCity)

 Any help would be appreciated. Thanks.

Coco_SdyneyCoco_Sdyney
AND(NOT(BillingCountry = "CAN"), NOT(BillingCountry = "USA"),
VLOOKUP( 
$ObjectType.Zip_Code__c.Fields.City__c , 
$ObjectType.Zip_Code__c.Fields.Name , 
BillingPostalCode) <> BillingCity)