Thursday, 23 September 2010

Bing Maps and Microsoft Dynamics CRM 2011

 

Very quick solution to show a Bing map in Accounts in CRM 2011.

clip_image002

Step 1 – Create a .js file with the following code:

Function bingmap()
{
var AccountStreet = crmForm.all.address1_line1.DataValue;
var AccountCity = crmForm.all.address1_city.DataValue;
var AccountState = crmForm.all.address1_stateorprovince.DataValue;
var AccountZip = crmForm.all.address1_postalcode.DataValue;

var MapURL = "http://maps.msn.com/home.aspx?strt1=" + AccountStreet + "&city1="+ AccountCity+"&stnm1=" + AccountState + "&zipc1=" + AccountZip + "&cnty1=2";

if (MapURL != null)
{
crmForm.all.IFRAME_map.src = MapURL;

}
}

Step 2 – Create a new Web Resource and choose the .js file you just created:

clip_image004

Step 3 – Create a section in your Account form and insert an iFrame called ‘map’:

clip_image006

Step 4 – In the Form Properties, call the Web Resource you created:

clip_image008

Step 5 – Save and Publish

This should give you a Bing Map of the Account Address.

There are various ways you can change views etc, so just refer to the Bing Maps SDK:

http://www.microsoft.com/maps/isdk/ajax/

1 comments:

  1. Bing maps have definitely improve. The UI had a make-over for a more polished look while the added functionality for memory is very well appreciated.
    search engine optimisation australia

    ReplyDelete