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
sgoldbergsgoldberg 

Country Validation

Hi

I am trying to validate that the BillingCountry field matches our specifications. I thought the best way to do this would be to create a validation rule that did a vlookup on a custom object which had a list of the correct countries. The problem is I can't figure out how to create the custom object properly. Thanks in advance for the help. 
arnt72arnt72
basically your custom object just needs one field. VLOOKUP uses two fields on your lookup object but I think you can use the same field twice. Otherwise, just leave the second field blank. Then you have to create one record for every valid country.

It might be more user-friendly if you put all these valid county names in a picklist and write a short apex trigger that transfers that value into the Billing Country. Otherwise users might get stuck in trial and error trying to figure out the correct spelling of the country ('China? PRC? Republic of China? How am I supposed to know...').


Message Edited by arnt72 on 10-13-2008 06:22 PM
JPSeaburyJPSeabury
Be careful with either approach.  At present, there are 246 country codes listed in ISO 3166.  In my experience wrestling with this, the list changes far more frequently than I originally expected.