Using Google Map in AX 2012 CU7 R2

In class declaration

#Define.GoogleMapUrl(‘http://maps.google.com?q=\%1’)

*******************************************************************************

Form Init method

url = “Harmain Street” +”,”
+ “Jiddah” +”,”
+ “SA-02″ +”,”
+ “6101” +”,”
+ “SAU”;
url = strReplace(url, “\n”, “,”); // replace newline with commas
url = strfmt(#BingMapURL, url);

super();
ActiveX.Navigate(URL);
ActiveX.allowEdit(false);

*******************************************************************************

void clicked()
{
FormRun formRun;
Args args = new Args();

// #Define.MapURL(‘http://www.bing.com/maps/?q=\%1’)
;
url = Address.Street +”,”
+ Address.City +”,”
+ Address.State +”,”
+ Address.ZipCode +”,”
+ Address.CountryRegionId;
url = strReplace(url, “\n”, “,”); // replace newline with commas

url = System.Web.HttpUtility::UrlEncode(url);

args.name(formstr(MapViewer));
args.parm(strfmt(#BingMapURL, url));
formRun = classFactory.formRunClass(args);

formRun.init();
formRun.run();
formRun.wait();
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s