Opening web pages from menu items in Dynamics AX

This post will show you how to open a web page from a menu item in the standard Microsoft Dynamics AX client. It includes a brief code sample with a step-by-step explanation of how to set up the menu item. Enterprise Portal is not required for this scenario.

Installation

Download and install the SharedProject_LaunchWebBrowser.xpo file into your test environment.

The code to open the web browser is located in the run() method.

public void run()
{
    ;

    if (url)
    {
        infolog.urlLookup(url);
    }
    else
    {
        error("Cannot launch web browser because no URL has been specified.");
    }
}

Notice the properties on the LaunchWebBrowser menu item.

Navigate to AOT > Menus. Right-click on the Administration menu and select Open New Window. Drag and drop the LaunchWebBrowser menu item onto the Administration menu.

Testing

Close your AX client and then restart it. You should now be able to see your new menu item in the Administration > Common Forms section. When you click the Launch web browser menu item, the default web browser on your workstation will open the web page specified in the Parameters property.

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