Tip of the Week #149 – Run Your Dynamics NAV 2018 Web Client Without an Internet Connection

Tip of the Week #148 – Run Your Dynamics NAV 2018 Web Client Without an Internet Connection

This week Developer Peter Tijsma has a great tip for print companies, based on a question received from one of our latest, large implementations in North America.

By default, one needs internet connection for the Dynamics NAV Web Client to work. This is because the Web Client uses JavaScript files like jQuery to function properly – and these scripts are by default always loaded from the Microsoft AJAX CDN (Content Delivery Network), to ensure the latest scripts are used.

However, print shops will typically have Web Clients running in their Shop Floor environments, and don’t want their users to be browsing the Internet during work hours – and thus do not grant internet access to those stations.

But – by restricting internet access from those stations, the Web Client is rendered unusable.

Hmm, tough choice… so, must we allow Shop Floor users need to browse their personal favorite websites and shop online just because they also need to access the company’s ERP System?

Luckily, Microsoft has a built in a hidden (undocumented) feature in the navsettings.json (the configuration file of the Web Client) which allows the Web Client to use the required JavaScript files from the local Web Server instead.

Use the following script in PowerShell on your Web Server to set this setting:

Import-Module “C:\Program Files\Microsoft Dynamics NAV\110\Web Client\Modules\NAVWebClientManagement\NAVWebClientManagement.psm1”

$WebServerInstance = “<yourinstancename>”

Set-NAVWebServerInstanceConfiguration -WebServerInstance $WebServerInstance -KeyName ‘LoadScriptsFromCdn’ -KeyValue $false

Start-Process -FilePath ‘IISRESET.EXE’ -Wait -NoNewWindow

 

Simply replace <yourinstancename> with the Web Server Instance Name for the Web Client that needs to use the scripts from the local server and run the script.

Tip: The WebServerInstanceName can be found in the URL to the Web Client: https://mywebserver.mydomain.com/WebServerInstance/WebClient

When you inspect the source of the Web Client you’ll notice these kind of differences:

 

Before:

After:

Et Voilà! The Shop Floor users can now happily access your companies ERP system without the ability to do any personal browsing.

Thanks to Stefano Demiliani for finding this hidden gem.

Source: https://community.dynamics.com/nav/b/stefanodemiliani/archive/2018/03/08/microsoft-dynamics-nav-web-client-hack-to-work-offline