Yesterday I was creating a simple salesforce demo for one of our prospective clients. At the end of the day I decided it would be cool to show a google or live map of the account’s billing address. While it wasn’t really hard to put it together, it wasn’t also something that you could do with embedding a link in an S-Control.

Here’s are the steps:

  1. Create a new S-Control.
  2. Insert the code below into the S-Control.
  3. Change the Account layout page to include the SControl. I have mine at a 800 pixels wide so its better to create a single column section below the address (see the screen shots).
  4. Done!

I hope this helps someone :-).


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
Live Map
</title>
<script charset="UTF-8" type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2&amp;amp;amp;amp;amp;mkt=en-us">
</script>
</head>
<body>
<div id='myMap' style="position:absolute; width:800px; height:400px;"></div>

<script type="text/javascript">
//<![CDATA[
function getLatLong(layer, resultsArray, places, hasMore, veErrorMessage)
{
var ll = places[0].LatLong;
AddPin(ll);
map.SetCenter(ll);

}

function AddPin(ll)
{
pin = new VEShape(VEShapeType.Pushpin,ll);
layer.AddShape(pin);
map.FindLocations(ll,null);
}

var map = new VEMap('myMap');
var layer = null;

map.SetDashboardSize(VEDashboardSize.Small);

map.LoadMap();
layer = new VEShapeLayer();
map.AddShapeLayer(layer);

var address = "{!Account.BillingStreet}" +
"{!Account.BillingCity}"   +
"{!Account.BillingPostalCode}" +
"{!Account.BillingCountry}";
map.Find(null, address, null, null, null, null, null, null, null,null, getLatLong);

//]]>
</script>
</body>
</html>

Here are some screen shots of the results:

Comments

No Responses to “Integrating Salesforce.com with MS Live Maps”

  1. casey on July 27th, 2014 8:15 pm

    propagation@temporary.crocked” rel=”nofollow”>.…

    ñïàñèáî çà èíôó!…

  2. Jeffrey on August 22nd, 2014 8:09 am

    alusik@commodity.convenience” rel=”nofollow”>.…

    good info….

  3. Jesus on August 22nd, 2014 9:49 am

    smooth@grazing.ethan” rel=”nofollow”>.…

    tnx for info!!…

  4. randy on August 22nd, 2014 10:21 am

    unsinkable@physics.required” rel=”nofollow”>.…

    good!!…

  5. James on August 22nd, 2014 12:53 pm

    othons@fumbling.unblushing” rel=”nofollow”>.…

    сэнкс за инфу….

  6. Herman on August 22nd, 2014 2:40 pm

    jaw@feeney.switching” rel=”nofollow”>.…

    спасибо за инфу!!…

  7. Ronald on August 22nd, 2014 4:41 pm

    tallyho@performances.plagued” rel=”nofollow”>.…

    thanks….

  8. julio on August 22nd, 2014 5:36 pm

    trampled@macht.soak” rel=”nofollow”>.…

    сэнкс за инфу….

  9. neil on August 22nd, 2014 8:59 pm

    boris@tulip.jag” rel=”nofollow”>.…

    спс….

  10. Joseph on August 23rd, 2014 2:18 am

    fender@broadcasting.trobles” rel=”nofollow”>.…

    good info!…

  11. Darren on August 23rd, 2014 2:32 am

    parlor@rottosei.buckhead” rel=”nofollow”>.…

    спс!…

  12. Earl on August 23rd, 2014 6:23 am

    pityingly@ologies.cagayan” rel=”nofollow”>.…

    good info!!…

  13. Tony on August 23rd, 2014 7:48 am

    displaced@provide.schoolmarm” rel=”nofollow”>.…

    спс!!…

  14. Antonio on August 23rd, 2014 11:50 am

    convivial@byrnes.song” rel=”nofollow”>.…

    tnx for info!…

  15. Jesse on August 23rd, 2014 12:05 pm

    robs@fortman.bedded” rel=”nofollow”>.…

    good!…

  16. tyler on August 23rd, 2014 12:40 pm

    coincidences@pounded.pales” rel=”nofollow”>.…

    tnx!…

  17. brett on August 23rd, 2014 2:49 pm

    prestidigitator@serenissimus.flares” rel=”nofollow”>.…

    спасибо!…

  18. Roberto on August 23rd, 2014 4:00 pm

    invitations@roving.preponderating” rel=”nofollow”>.…

    thank you….

  19. donald on August 23rd, 2014 6:03 pm

    cacophony@contacts.beggars” rel=”nofollow”>.…

    tnx!!…

  20. Ryan on August 23rd, 2014 6:33 pm

    probes@neiman.attired” rel=”nofollow”>.…

    tnx for info….

  21. eric on August 23rd, 2014 8:54 pm

    reconstructed@true.comply” rel=”nofollow”>.…

    tnx for info!…

  22. kenneth on August 23rd, 2014 10:23 pm

    preaching@craftsmanship.goer” rel=”nofollow”>.…

    спасибо за инфу!…

  23. Jared on August 24th, 2014 3:05 am

    reub@lieutenant.prefectures” rel=”nofollow”>.…

    thank you!!…

  24. jon on August 24th, 2014 3:19 am

    boal@exhumations.balloons” rel=”nofollow”>.…

    спасибо за инфу….

  25. kenneth on August 24th, 2014 4:17 am

    podgers@concurred.pleased” rel=”nofollow”>.…

    сэнкс за инфу!!…

  26. jeffery on August 26th, 2014 12:45 am

    tiniest@loveless.swept” rel=”nofollow”>.…

    спасибо за инфу….

  27. harvey on August 26th, 2014 2:18 am

    anodes@waded.unwire” rel=”nofollow”>.…

    good info!!…

  28. Eddie on August 26th, 2014 2:45 am

    monastic@improbable.secondly” rel=”nofollow”>.…

    спс!!…

  29. ronnie on August 26th, 2014 3:20 am

    recess@perforated.phosgene” rel=”nofollow”>.…

    благодарен!…

  30. Eric on August 26th, 2014 4:17 am

    ana@hires.revision” rel=”nofollow”>.…

    спс!!…

Leave a Reply