NTBuddy

A place to learn about Microsoft SharePoint and Microsoft Dynamics CRM

Country Field

I will typically add this code to the onLoad event as well as the onChange event for the Country fields. This helps in providing consisting and uniformity across the CRM website. This also greatly helps when searching for the country as you know it will comply with the standard set in place.

// Convert country to USA

if (crmForm.all.shipto_country.DataValue != null) {

   var sCountry = crmForm.all.shipto_country.DataValue;

   if (sCountry == null) sCountry = "usa";

   sCountry = sCountry.replace(/us/gi,"usa");

   sCountry = sCountry.replace(/usaa/gi,"usa");

   sCountry = sCountry.replace(/united states/gi,"usa");

   sCountry = sCountry.replace(/united states of america/gi,"usa");

   crmForm.all.shipto_country.DataValue = sCountry.toUpperCase();

}