Adding an IFrame showing accounts address on Hitta.SE
If you are using MSCrm you might find the below hack useful: it frames in the swedish directory/map service "Hitta.SE" for accounts to show the accounts address on the map.
First, go into MSCrm Customoziation mode and add a new Tab to the Account Form. Name the tab "Hitta.SE" (or whatever you find appropriate).
Then, place a section and inside the section place an IFRAME object.
Name the IFrame "IFRAME_hittase". The name is important as it will be used in the script below to reference the iframe element. Add any url (not important as it will be changed by the load script below).
Make sure to uncheck the "Restrict cross-frame scripting" checkbox.
Make the IFrame fill up the entire available space.
Click OK.
Then, click on Form properties, and select the OnLoad event and push Edit button.
Add the below script in the script edit textbox and click OK.
// position hitta.se map
var iframe;
iframe = document.getElementById('IFRAME_hittase');
var queryAddress;
queryAddress = crmForm.all.item("address1_line3").DataValue;
var boxMatch=/box/gi;
if( !queryAddress || queryAddress.match(boxMatch))
queryAddress = crmForm.all.item("address1_line1").DataValue;
if( !queryAddress || queryAddress.match(boxMatch))
queryAddress = '';
else
queryAddress += ' ';
queryAddress += crmForm.all.item("address1_city").DataValue;
var re = /[ åäöÅÄÖ]/g;
queryAddress = queryAddress.replace(re, function($0) {
if($0==' ') return '+';
if($0=='å') return '%E5';
if($0=='ä') return '%E4';
if($0=='ö') return '%F6';
if($0=='Å') return '%C5';
if($0=='Ä') return '%C4';
if($0=='Ö') return '%D6';
});
iframe.src = 'http://www.hitta.se/SearchCombi.aspx?SearchType=4&UCSB%3ATextBoxWhere=' + queryAddress + ' &UCSB%3AButtonSearch=++hitta%21++&CombiResults%3AUserControlMapControl%3ApointsHidden=&CombiResults%3AUserControlMapControl%3Az=9#Map';
Commit all changes by clicking OK all the way "back" and then Publish the changes.
Now, bringing up an Account would load the Hitta.SE iframe with a search for the accounts address/city.