Country Code Conversion Plugin


OVERVIEW

NOTE:  The following documentation applies to EasyTerritory integrated with Microsoft Dynamics 365/CRM and is available as part of EasyTerritory’s managed solution published on or after January 9, 2019.

EasyTerritory recommends that geocoding be done using a Country Code (2-character) instead of a Country Name (text string) because Bing Maps and Azure Maps are better at recognizing ISO-Alpha 2 values when searching for an address.  To help organizations who don’t currently have the Country Code available in their customer data, EasyTerritory developed the Convert to Country Code plugin.

The Convert to Country Code plugin is a workflow activity, that is, it is used as a step in a workflow process.  The plugin takes a country name as a text or Option Set value (non-numeric) and does a lookup against a managed list of all recognized countries.  The plugin will return the matching 2-character Country Code (ISO-Alpha 2) to be set on a text field on your entity (Accounts, Leads, Opportunities, etc.).  The Country Code field can be added to your Geocode Workflow so your records can be geocoded more accurately.

SETUP

To begin, import the managed solution (dated 1/9/2019 or later) and create a Country Code field (single line of text) on your entity (Accounts, Leads, Opportunities, etc.) to store the 2-character Country Code response from the plugin.

Now create a workflow on the target entity (Accounts, Leads, Opportunities, etc.) that will start when a new record is created, when the Country Name or Country/Region field changes, and can be run on-demand.

It would be good to include a Wait Condition to confirm the Country Name or Country/Region field contains data.

Now create a step that calls the EasyTerritory.Plugins.ConvertToCountryCode plugin and takes the Country Name or Country/Region field.

Next, create a step that updates your new Country Code field on the target entity.

Now, when a country name is entered into the Country/Region field, and the record is saved, the workflow will be triggered to lookup the country name, return the Country Code, and populate the supplied field so the record can be geocoded accurately.

NOTE:  If the supplied Country Name is not found in the master list of countries the system job will fail with an error: “The country code value of ______ does not exist in the list.”  Check the supplied Country Name for accuracy (spelling/punctuation).  If the supplied Country Name is accurate then it may need to be added to our master list.  We can be notified of this at Support@EasyTerritory.com.

Finally, this field can be added to your Geocode Workflow, and the EasyTerritory Bulk Operations Utility can be used to run the Country Code Conversion and Geocode Workflows in bulk.

For questions or support regarding this plugin, please email: Support@EasyTerritory.com.