First thing you have to do is to get key to work with Bing services. This can be done here - https://www.bingmapsportal.com/. Register your application and copy key.
I've build my solution based on this article. The code:
RefreshCoords = function()
{
var bingkey = "Paste your Key here";
var address = '';
if (crmForm.all.address1_line1.DataValue != null)
address += crmForm.all.address1_line1.DataValue;
if (crmForm.all.address1_line2.DataValue != null)
address += (address == '' ? '' : ' ') + crmForm.all.address1_line2.DataValue;
if (crmForm.all.address1_city.DataValue != null)
address += (address == '' ? '' : ' ') + crmForm.all.address1_city.DataValue;
if (crmForm.all.address1_stateorprovince.DataValue != null)
address += (address == '' ? '' : ' ') + crmForm.all.address1_stateorprovince.DataValue;
if (crmForm.all.address1_postalcode.DataValue != null)
address += (address == '' ? '' : ' ') + crmForm.all.address1_postalcode.DataValue;
var url = "http://dev.virtualearth.net/REST/v1/Locations?q=" + address + "&o=xml&key=" + bingkey;
try
{
var xHReq = new ActiveXObject("Msxml2.XMLHTTP");
xHReq.Open("GET", url, false);
xHReq.Send(null);
var resultXml =xHReq.responseXML;
var long = parseFloat(resultXml.selectSingleNode(""//Response/ResourceSets/ResourceSet/Resources/Location/Point/Longitude").nodeTypedValue);
var lat = parseFloat(resultXml.selectSingleNode("//Response/ResourceSets/ResourceSet/Resources/Location/Point/Latitude").nodeTypedValue);
crmForm.all.address1_latitude.DataValue = lat;
crmForm.all.address1_longitude.DataValue = long;
crmForm.all.address1_latitude.ForceSubmit = true;
crmForm.all.address1_longitude.ForceSubmit = true;
}
catch(e){}
}

Like
Report
*This post is locked for comments