Google Maps For Ms CRM Forms


Recently , we have a requirement from client , to show the address on google maps. To achieve this requirement, By default we are going with Bing Maps. But if you goes with Bing Maps, It will asks the AcessKey (Not for trail instances). We have to buy the access key from MS. So client doesn’t approve this method. Alternately we are achieving the requirement thorough google maps via adding new WebResource as HTMl Page on a form.

Default On loading the form, It will shows the Hyderabad as base address with latitude and longitudes (17.384509, 78.486156).


Add  new section and place anywhere within your Account Form. Am  placing the new Section below the Address Composite Field and labeled the Section as “googlemaps”.


Place the cursor on the new section and click on insert – select new web-resource


Add the new web resource with type Html as follows



Paste the following html code inside that Text Editor- Source

//Google Maps Code- with default Hyderabad location// //if u want to change then, change the latitude and Longitudes.


 function Map() {
 var map_canvas = document.getElementById('map_canvas');
 var map_options = {center: new google.maps.LatLng(17.384509,78.486156),zoom: 16,mapTypeId: google.maps.MapTypeId.ROADMAP}
 var map = new google.maps.Map(map_canvas, map_options)
 var geocoder = new google.maps.Geocoder();
 var address ='address1_composite').getValue();
 geocoder.geocode( { 'address': address}, function(results, status) {
 if (status == google.maps.GeocoderStatus.OK) 
 var marker = new google.maps.Marker({map: map, position: results[0].geometry.location});
 else {
 //alert("Geocode was not successful for the following reason: " + status);
 google.maps.event.addDomListener(window, 'load', Map);

</body> </html>
While uploading the code , word press doesn’t allowing some  lines of code at script and div. Please Go through Image.

After Pasting the code, click on Add Option 




Click on Save And Publish.6

Creating a new account record. , it will shows the Default Hyderabad location.Screenshot (328)

If we have data on the address composite field then Refresh the form and  it will shows the output as follows.



Crming- Enjoy 🙂



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s