State and Country Picklists

IMPORTANT: If your Salesforce org is configured to use/not use these picklists, you will also need to activate/disable their usage in Magento via Salesforce configuration

Salesforce module provides you with the ability to enable "State and Country Picklists" option. It changes the country and state fields in Salesforce to leverage "drop down" form fields

Case 1: Disabled State and Country Picklists in Magento and Salesforce

  1. Go to Magento Admin panel

  2. Click Salesforce (on left side bar) - General Configuration - Advanced (tab)

     

  3. Set the "State and Country Picklists" option to "Disable"

  4. Click Save Config

The result in Salesforce

 

Case 2: Enabled "State and Country Picklists" option in Magento & Salesforce 

  1. Go to Magento Admin panel

  2. Click Salesforce (on left side bar) - General Configuration - Advanced (tab)

     

  3. Set "State and Country Picklists" option to "Enable" and Save Config

The result in Salesforce

Possible Errors and Issues

Possible error when Salesforce and Magento “State and Country Picklists“ configuration is mismatched

Country and State fields are empty in Salesforce Order page after synchronization. In case when “State and Country Picklists“ option is enabled for Magento, but disabled for Salesforce

 

Order is not synchronized. Error in “From Magento queue“ appears. In case when “State and Country Picklists“ option is enabled for Salesforce but disabled for Magento

  • Go to Magento Admin panel - Salesforce - Queues - From Magento

There's a problem with this country, even though it may appear correct. Please select a country/territory from the list of valid countries.: Billing Country, fields [BillingCountry] There's a problem with this country, even though it may appear correct. Please select a country/territory from the list of valid countries.: Shipping Country, fields [ShippingCountry]

 

Countries batch import

Salesforce State and Country/Territory Picklists does not contain all necessary State/Province for many countries. To avoid hours of manual creation of new states, you could use some 3rd party Non-Salesforce Application
For example statecodes package
GitHub - mattandneil/statecodes: Automatically creates all ~5000 values for state and country picklists

Related articles