Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

Microsoft Dynamic CRM 4.0 : Google Maps Integration

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
12/28/2011 3:42:30 PM
Similar to how Microsoft Live Search maps are created, Google uses an integrated HTML page to show its mapping technology. One main difference, however, is the requirement for a Google API key. This is a required step and is dependent on the URL of your site. The key can be obtained from http://code.google.com/apis/maps/signup.html, after agreeing to various terms and conditions.

Note

You must have a Google account to create the Google API key. Currently, both of these services are free.


To obtain a Google API key, complete the following steps:

1.
Navigate to http://code.google.com/apis/maps/signup.html and agree to the terms and conditions, and enter the URL for your website. Because we’ll be using a virtual directory called Maps in this example, we’ll include it in the URL. Select Generate API Key to continue, as shown in Figure 1.

Figure 1. Google API key terms and URL.

2.
You will be asked to sign in to Google accounts, and you will then receive your Google Maps API key, as shown in Figure 2.



Figure 2. Generate a Google Maps API key.

3.
Create a new HTML page with the following code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>MSCRM Google Map</title>

<script src="http://maps.google.com/maps?file=api&amp;v=2.x&amp;key=<< Enter Key Here>>"
type="text/javascript"></script>
<script type="text/javascript">

var gMap = null;
var geocoder = null;

function initialize()
{
if (GBrowserIsCompatible())
{

var crmAddress = GetCRMAddress();

if(crmAddress != ',')
{
gMap = new GMap2(document.getElementById("MapHolder"));
//gMap.setCenter(new GLatLng(37.4419, -122.1419), 13);
geocoder = new GClientGeocoder();
LocateAddress(crmAddress);
}
else
{
DisplayMessage();
}
}
}
function LocateAddress(address)
{
if (geocoder)
{
geocoder.getLatLng(address,function(point)
{
if (!point)
{DisplayMessage();}
else
{
gMap.setCenter(point, 13);
var marker = new GMarker(point);
gMap.addOverlay(marker);
marker.openInfoWindowHtml(address);
}
}
);
}
}

function GetCRMAddress()
{
var schemaNames = 'address1_line1,address1_line2,address1_line3,address1_city, address1_stateorprovince,address1_country,address1_postalcode';
var schemaNameArray = schemaNames.split(",");
var address = '';

for(count = 0; count < schemaNameArray.length; count++)
{
var o = parent.document.getElementById(schemaNameArray[count]);

if(o != null)
{
if(o.value != '')
{
address = address + ',' + o.value ;
}
}
}

return address;
}

function DisplayMessage()
{
var lbl = document.getElementById('lblMessage');
lbl.style.display = "inline";

var div = document.getElementById('MapHolder');
div.style.display = "none";
}
</script>

</head>
<body>
<body onload="initialize()" onunload="GUnload()">
<form>
<div id="MapHolder" style="width: 700px; height: 350px">
</div>
<label id="lblMessage" style="display:none; font-family:@Arial Unicode MS; font-size:small; font-weight:bold; color:#15428b;">
         Unable to locate the given address in Google Maps – Please update the address information and save the record then try again.</label>
</form>
</body>
</body>
</html>


Note

Replace the << Enter Key Here>> with the key you received in step 2.


Figure 3 shows Microsoft Dynamics CRM with Google Maps integration.

Figure 3. Google Maps integration.
Other -----------------
- Microsoft Systems Management Server 2003 : Disaster Recovery - Backing Up the Site Through Systems Management Server
- Microsoft Systems Management Server 2003 : Disaster Recovery - Backup Process Flow
- InfoPath with Sharepoint 2010 : Create a Master or Detail Display Form for SharePoint Lists
- Add an InfoPath Form Web Part to a SharePoint Web Part Page
- Working with the Windows Home Server 2011 Registry : Keeping the Registry Safe
- Working with the Windows Home Server 2011 Registry : Starting the Registry Editor & Navigating the Registry
- BizTalk 2006 : Deploying and Managing BizTalk Applications - Important Deployment Artifacts
- BizTalk 2006 : Deploying and Managing BizTalk Applications - BizTalk Applications
- Microsoft Dynamics AX 2009 : Changing automatic transaction text
- Microsoft Dynamics AX 2009 : Creating and posting ledger vouchers
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server