Display a Google Map for an Account
Recently I delivered a private bootcamp for a consulting firm, and one of the students in that most excellent group embarassed me by finding a piece of information on my own site that I couldn’t find! It turns out she was authenticated on our Student Portal and this little nugget was a locked-down announcement on the portal. I was anonymous at the time and it wasn’t exposed outside. A little too well-hid, I thought to myself, so I re-used it for a blog post.
here’s the orignial post, from April of 2008:
I’d been close on this a bunch of times but kept getting a script error (something like “GMap Application undefined…”). But then in San Francisco, Glen Willson of Millenium Systems showed me this code snippet that actually works! Here’s the note from Glen (with working jscript):
This is how I did it: Made a new tab with an iFrame, added a custom bit value (yes or no radio buttons) called “shmap” and added this code as an onchange event. Enjoy!! …and don’t forget my credit on the web page!
if (crmForm.all.address1_postalcode.DataValue != null){
crmForm.all.IFRAME_gmap.src = “http://maps.google.com/maps?q=” +
crmForm.all.address1_line1.DataValue + “+” + crmForm.all.address1_city.DataValue + “,+” + crmForm.all.address1_postalcode.DataValue;
}
crmForm.all.address1_line1.DataValue + “+” + crmForm.all.address1_city.DataValue + “,+” + crmForm.all.address1_postalcode.DataValue;
}
else
{
crmForm.all.IFRAME_gmap.src = “about:blank”
}
{
crmForm.all.IFRAME_gmap.src = “about:blank”
}
*******
There you have it. Thanks Glen — you rock!


Frank Wilson Said,
June 9, 2010 @ 10:01 am
Thanks for the tip and the code. However, I just wanted to point out that in most cases, this would require a license (not free) from Google. The catch is that it is only free if you’re going to display the map on a publicly accessible web site. Obviously that isn’t going to be the case with most CRM implementations.
Richard Knudson Said,
June 9, 2010 @ 10:09 am
Hi Frank, thanks for the note and the clarification. You have to purchase a license to the Google api or something along those lines, right? Do you know how much it costs? I think with the MS maps approach there’s a free version, but it’s been a while since I checked into it.
Richard