The Microsoft Dynamics NAV Web client can be deployed as an independent website. In some cases, it is useful to embed parts of the Microsoft Dynamics NAV Web client in other websites, for example, in order to build an internal company portal that not only contains data from Microsoft Dynamics NAV, but also contains news feeds, document handling, and so on
You can do this by adding an iframe element on the embedding website, such as: <iframe src=”http://MyWebServer/DynamicsNAV71/WebClient/list.aspx?...” />
. The Microsoft Dynamics NAV Web client will display the ribbon, the navigation pane, and other UI parts inside the frame. You can update the Microsoft Dynamics NAV Web client to hide the ribbon, the navigation pane, or any UI parts, and only display the core part of the list inside the frame.
Note |
---|
In Microsoft Dynamics NAV, only list pages are supported as framed pages. |
Important |
---|
Certain data in the URL, such as company name, could be considered sensitive information. Use discretion if you distribute URLs that contain the company name, or if it is possible, exclude this information from the address. |
Example
The following URL displays page 22 Customers for the CRONUS International Ltd. Company. The page is displayed in a Microsoft Dynamics NAV Web client that is running on a computer that has the name MyWebServer. The page is displayed without the ribbon, the navigation pane, and any UI parts.
Copy Code | |
---|---|
http://MyWebServer/DynamicsNAV71/WebClient/list.aspx?company=CRONUS%20International%20Ltd.&page=22&showribbon=0&shownavigation=0&showuiparts=0 |
For more information about the page address syntax, see Opening a Page in the Microsoft Dynamics NAV Web Client by Using a URL.
iframe Parameters
The following table describes the parameters of the URL for displaying a list page in an iframe.
Parameter | Description |
---|---|
| Specifies the Internet protocol to use. Valid options are The |
| Specifies the name of the computer that is running the Microsoft Dynamics NAV Web client. |
| Specifies the name of the web server instance for the Microsoft Dynamics NAV Web client. On IIS, this is the alias of the virtual directory of the web server instance. When you install the Microsoft Dynamics NAV Web client using Microsoft Dynamics NAV Setup, the web server instance is given the same name as the Microsoft Dynamics NAV Server instance that it connects to. If you use the New-NAVWebServerInstance cmdlet to add Microsoft Dynamics NAV Web client instances, then you specify the web server instance name. For more information, see How to: Set Up Multiple Web Server Instances for the Microsoft Dynamics NAV Web Client. |
| Specifies the name of the active server page file to use to display the page. You can use any of the following types, regardless of the page type: |
| The name of the company in Microsoft Dynamics NAV for which you want to display the page. If you do not select a company, then Microsoft Dynamics NAV Web client uses the company that is defined in the web.config file. If no company is defined in the web.config file, then the last company opened by the user is displayed. |
| Specifies the mode in which to display the page.
|
| Specifies whether to show the ribbon when the specified page opens. The default value, if the parameter is not specified, is |
| Specifies whether to show the navigation page when the specified page opens. The default value, if the parameter is not specified, is |
| Specifies whether to show UI parts when the specified page opens. The default value, if the parameter is not specified, is |
| Specifies the navigational behavior of the Microsoft Dynamics NAV Web client. If the Microsoft Dynamics NAV Web client is run as part of an external web site, the Use the Back button on the web browser to return from a list. If a card was activated, the original web site is rendered when the card is dismissed. The default value, if the parameter is not specified, is |
| Specifies the number of lines to display in a grid control, which is useful when embedding the Microsoft Dynamics NAV Web client. The default value, if the parameter is not specified, is |
Embedding the Microsoft Dynamics NAV Web Client in a Website on Another Web Server
By default, the Microsoft Dynamics NAV Web client will not allow a website to display the web client inside an iframe unless the website is hosted on the same web server. This is enforced by having the default value of X-FRAME-OPTIONS
in the web.config file set to SAMEORIGIN
.
Copy Code | |
---|---|
<httpProtocol> <customHeaders> <!-- SAMEORIGIN: allows framing of the Microsoft Dynamics NAV Web client in another website only if the other website is on the same host. Remove this to enable cross-site framing of the Microsoft Dynamics NAV Web client, but be aware of the increased risk of clickjacking, which could deceive a legitimate user into taking unintended actions on behalf of the attacker. --> <add name="X-FRAME-OPTIONS" value="SAMEORIGIN" /> </customHeaders> </httpProtocol> |
In order to show a list page in an HTML site on a different host, the Microsoft Dynamics NAV Web client web.config file has to be configured by removing the <add name="X-FRAME-OPTIONS" value="SAMEORIGIN" />
line from the web.config file.
Warning |
---|
Be aware that if you remove the <add name="X-FRAME-OPTIONS" value="SAMEORIGIN" /> line from the web.config file, it can pose a potential security risk. |