Configure StateCountry Code mapping correctly in Salesforce to avoid integration errors
Integration errors occurring due to incorrect State and Country code mapping can be resolved by configuring the Salesforce forms with the correct integration values for States and Countries.
You encounter the following error when the state/country mapping is incorrect.
“Error | There’s a problem with this state, even though it may appear correct. Please select a state from the list of valid states.”
The error occurs because State and Country codes are represented differently in NetSuite and Salesforce applications. In the NetSuite customer form or contact form, even though the state field may look like a name, e.g. California, behind the scenes, NetSuite uses a 2-letter ISO code to represent the data. The solution is to set up the Salesforce Integration Values to have the 2-letter codes. The following are the steps you need to complete in the Salesforce Setup section.
In Salesforce, go to Setup.
In the quick search, type "country", select State and Country picklist.
Then, click on the hyperlink that says “Configure states and countries”
This brings you to a screen with a list of Countries.
Scroll down to the United States and click the Edit button to modify the record.
For the Integration App (SmartConnector) to work correctly, change the Integration Value for United States to “US”.
Then, edit each State, and change the Integration Value for each state so that it is the 2-character ISO code.
Example: In the Integration Value section, modify the state ‘Arizona’ to’ AZ’
The following is the default setting:
Here’s what it should be:
Note: This error occurs in Salesforce v2 and does not happen in Salesforce v1 because, in v1, a backend server translates state and country codes into the acceptable values automatically during integration.