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 : Microsoft Live Search Maps

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
12/18/2011 5:49:01 PM
Also known as MSN Maps or Bing Maps, Microsoft Live Search Maps is part of Microsoft’s Virtual Earth framework and provides mapping technology. Another way to think of Live Search Maps is as a website that offers extensibility options while utilizing Microsoft’s Virtual Earth as the underlying platform.

Note

Microsoft Virtual Earth can be licensed separately and offers a greater set of capabilities than the Microsoft Live Search Maps application. Therefore, developers seeking to do more than simple address lookup mapping should look at the Microsoft Virtual Earth product.


Figure 1 shows the Microsoft account in Microsoft Dynamics CRM with a new tab called Live Map that has the Live Search Maps integrated.

Figure 1. Microsoft Live Map integration.

We can easily scroll or change the orientation on the map once it is loaded, and we can change the view options available across the top. Figure 2 has the same location, but Bird’s Eye is selected.

Figure 2. Microsoft Live Maps integration with Bird’s Eye selected.

To create a Live Search integration, complete the following steps:

1.
Use the following code to create a new web page with an .htm extension:

<!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>
<title>MSN Map</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<script type="text/jscript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=5"
mce_src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=5"></script>

<script type="text/javascript">

var vMap = null;

function initialize()
{
var crmAddress = GetCRMAddress();
if(crmAddress != '')
{
LocateAddress(crmAddress);
}
else
{
DisplayMessage();
}
}

function LocateAddress(address)
{
vMap = new VEMap('MapHolder');

vMap.LoadMap();

vMap.Find(null,address,null,null,0,10,true,true,true,true,MapAddress);
}

function MapAddress(shapeLayer, results, positions, moreResults, e)
{
if(positions != null && positions.length > 0)
{
addressLatLong = new VELatLong(positions[0].LatLong.Latitude,positions[0].LatLong.Longitude);

addressPushPin = new VEShape(VEShapeType.Pushpin,addressLatLong);

vMap.AddShape(addressPushPin);

vMap.SetCenterAndZoom(addressLatLong,15);
}
else
{
DisplayMessage();
}
}
function GetCRMAddress()
{
var address = '';

var addressLine1 = parent.document.forms[0].all.address1_line1.DataValue;

var postalCode = parent.document.forms[0].all.address1_postalcode.DataValue;

var city = parent.document.forms[0].all.address1_city.DataValue;

var stateOrProvince = parent.document.forms[0].all.address1_stateorprovince.DataValue;

var country = parent.document.forms[0].all.address1_country.DataValue;

if(addressLine1 == null && postalCode == null && city == null && stateOrProvince == null && country == null)
{
address = '';
}
else
{
address = addressLine1+", "+postalCode+" "+city+" ("+stateOrProvince+"), "+country;
}
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 onload="initialize()">
<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 selected address in Live Map - Add required Street, City and State information and then save the record.</label>
</form>
</body>
</html>


2.
Save the HTM into a new folder where the CRMWeb is served (normally in C:\Program Files\Microsoft Dynamics CRM Server\CRMWeb or in C:\InetPub\wwwroot). In this example, we’ve created a new directory called Maps, as shown in Figure 3. (Be sure the directory is configured in Internet Information Services [IIS] as a virtual directory.)

Figure 3. New IIS virtual directory for MSN Maps.


3.
Navigate to the customization screen for accounts in Microsoft Dynamics CRM, and add a new tab, section, and IFrame.

Be sure to configure the IFrame, as shown in Figure 4, by adding a name and the URL to the page you just created. In addition, be sure to unselect Restrict Cross-Frame Scripting in the Security section.

Figure 4. IFrame Properties page for Live Search integration.


4.
Display the Formatting tab and select Automatically Expand to Use Available Space.

5.
Save and publish the account.

This example will work with as many or as few of the parameters supplied. For example, if you have only a city, it will show the city. If there is no data entered on the saved form, the error message Unable to Locate the Selected Address in Live Map - Add Required Street, City and State Information and then Save the Record will display. (You can easily customize this on the HTML page by modifying the label tag with the ID of lblMessage.)

Other -----------------
- Configuring Email Settings in Windows Small Business Server 2011 (part 2) - Setting Mailbox Quotas & Moving Exchange Server Data
- Configuring Email Settings in Windows Small Business Server 2011 (part 1) - Configure a Smart Host for Internet Email & Using the POP3 Connector
- System Center Configuration Manager 2007 : Configuration Manager Queries - Relationships, Operations, and Joins
- System Center Configuration Manager 2007 : Configuration Manager Queries - Advanced Queries
- Active Directory Domain Services 2008 : Modify a Group Object Managed By Properties & Modify a Group Object Protection from Deletion
- Active Directory Domain Services 2008 : Modify a Group Object’s Type & Modify a Group Object’s Members
- Windows Server 2003 : Managing WWW Sites (part 4) - HTTP Headers Tab & Custom Errors Tab
- Windows Server 2003 : Managing WWW Sites (part 3) - Directory Security Tab
- Windows Server 2003 : Managing WWW Sites (part 2) - Home Directory Tab & Documents Tab
- Windows Server 2003 : Managing WWW Sites (part 1) - Web Site Tab & Performance Tab
 
 
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