Country/State Codes
Orgs with Country/State picklists enabled:
In Salesforce orgs that have the Country/State picklists enabled, country and state codes are defined in the Salesforce setup. However, the state (province, prefecture, etc) codes in particular do not always match those provided by Record Validation. The Country/State Codes setting lets you override the country and state codes as provided by Record Validation, so that they will match the codes as defined in the Salesforce setup.
Country and State picklists let users select countries and states from predefined, standardized lists, instead of entering country and state data into text fields. The picklists protect data integrity by preventing typos, alternate spellings, etc.
Record Validation checks whether an address is valid by matching it with its own data. When an address is entered using the country and state data as provided by Salesforce in the country/state picklist, and RV has a different code in its record for that country or state, it will not be considered valid. By mapping the RV codes to the Salesforce codes in the Country/State Codes setting, the address will be validated even when the country or state codes differ from one another.
Country codes
The country codes as provided by Record Validation will almost always match those of Salesforce, as for 239 countries and territories they both use the same ISO2 country code format. The option to override an RV country code is present, but you will most likely not need it. Notable exceptions are the codes for the following countries and territories:
- American Samoa (AS)
- Guam (GU)
- Hong Kong (HK)
- Marshall Islands (MH)
- Netherlands Antilles (AN)
- Northern Mariana Islands (MP)
- Serbia and Montenegro (CS)
- United States Minor Outlying Islands (UM)
These need to be added manually in Salesforce, and therefore might differ from the codes used by Record Validation.
State codes
Salesforce provides state or province codes for nine countries. These state codes do not always match those used by Record Validation, as the codes provided by RV and Salesforce can be the internationally used ISO2 codes, or alternative codes as used by the countries nationally. For countries other than these nine, you have to enter state codes manually in the Salesforce setup, leading to an even greater chance of discrepancy with what RV provides. This is where the Country/State Codes setting comes into play.
Country and state labels
In a State/Country picklist environment, the country and state labels can only be overridden in the Salesforce Setup. The country and state label overrides that you can set in the RV Setup are only intended for (custom) address field sets that do not make use of picklists.
Orgs that do not use Country/State picklists:
The country and state labels (names) as provided by Record Validation might not be exactly how you'd want them to be. For example, the English name might be used where you'd want the name in the local language, or RV might have an old name on record. By overriding the country or state label in the Country/State Code setting, you can use the labels as you want them to be.
Overriding codes and labels
For the country/state overrides to work correctly, apex class 'rv2ControllerCountryStateCodes' is needed.
Adding a country or state override
- In RV Setup, go to Country/State Codes on the left.
- At top right, click Add Country.



Adding a code override
- In the RV Country Code or State Code field, enter the code as it is provided by Record Validation
- In the Country Code Override or State Code Override field, enter the code as it is set in Salesforce setup
- Click Save

Adding a label override
- In the RV Country Code or State Code field, enter the code as it is provided by Record Validation
- In the Country Label Override or State Label Override field, enter the label you want to use instead of the label that is provided by RV
- Click Save

Deleting an entry
Delete an entry, either a single override row or an entire country block, with the applicable Delete button at the right of the row or block.