Category Archives: Microsoft Dynamics NAV 2016

How to install the NAV Web Client (Web Server Components)

In this article I will explain how to install the Web Server Components for Dynamics NAV 2016.

High-level steps:

1. Install the ‘Web Server Components’ from the Dynamics NAV DVD.
2. Start your internet browser and go to http://yourservername:8080.

More detailed steps:
1. Install the ‘Web Server Components’ from the Dynamics NAV 2016 DVD.
a. Start Setup.exe from the NAV DVD. Choose Custom and Select the option ‘Web Server Components’:

01

Click Next and leave all settings unchanged:

02

Some of the components that now will be installed:

– IIS Web Server
– IIS URL Rewrite Module 2
– Microsoft Dynamics NAV 2016 Web Client
– Language Module for the Microsoft Dynamics NAV 2016 Web Client

2. Start your internet browser and go to http://localhost:8080
a. Start ‘Internet Explorer’ and type in the URL: http://localhost:8080 You will now see the following:

03

b. You must add the name of your default service tier (NAV Instance) to the URL.

In my case it is ‘NST90Test’ so the URL will be:

http://localhost:8080/NST90Test/

04

 

If you want to ‘simulate’ a Tablet Client in your browser go to http://localhost:8080/NST90Test/tablet.aspx
If you want to ‘simulate’ a Phone Client in your browser go to http://localhost:8080/NST90Test/phone.aspx

The steps in this article only work if you install the Web Server Components on the same machine as your Dynamics NAV Server. The steps are quite easy in my opinion.

Want to install the Web Client on another server? Then additional configuration is needed. You can find more info about it on MSDN ‘Walkthrough: Installing the Microsoft Dynamics NAV Web Server Components on Three Computers‘.

If you install the NAV App on your tablet or smartphone it will not work because certificates are mandatory and more configuration is required then. Keep checking this site for more information about how to accomplish these things! More info will be added regularly.

You do not have access to Microsoft Dynamics NAV. Verify that you have been set up as a valid user in Microsoft Dynamics NAV.

Before you can access Microsoft Dynamics NAV you should be known as a user in the NAV database. (The only exception is when there a created no users at all then everyone will be granted access with SUPER permissions.) So when you haven’t been created (in NAV) as a user you will get the following warning when you try to access the database:

User Not Created

It’s really easy to fix this ‘problem’ with Powershell.

Global steps:

  • Start Powershell ISE
  • Import the NAV Administration Module
  • Run the cmdlet to Add yourself to the NAV database and grant yourself Permissions with another Cmdlet, please see the complete code at the end of this post.
  • Start the Windows Client (NAV)

I would recommend to use Powershell ISE. There are a lot of articles out there on the internet telling all the advantages it has.

How to import the NAV Administration Module:

Import-Module "$env:ProgramFiles\Microsoft Dynamics NAV\90\Service\NavAdminTool.ps1

Please mind that the module can only be loaded from the NAV Service Tier (NST) server, because the module is part of the NAV Administration Tools. Next, add the Windows Account you are using to start NAV with New-NAVServerUser:

New-NAVServerUser -ServerInstance $ServerInstance -WindowsAccount $WindowsAccount -Verbose

Adding yourself as a user isn’t enough. You also need to specify  which permission you have in NAV (authorization). If you are created as a user and try to start NAV you will now get the following warning:

No Permissions

This means you have no or not enough permissions although NAV knows who you are (authenticated) but that doesn’t mean you have the permission to read/start/do anything. So, in this example we will give the Windows account SUPER permissions (the highest privilege) in NAV. You can do this in Powershell with the New-NAVServerUserPermissionSet Cmdlet:

New-NAVServerUserPermissionSet -ServerInstance $ServerInstance -WindowsAccount $WindowsAccount -Verbose

Please replace $WindowsAccount with the User you want to give access and replace $Serverinstance with the proper NAV Instance. Below an example script where you only have to replace the ServerInstance variable. The script is automatically retrieving your current domain name and username. Let PowerShell work for you as much as possible… :)

$WindowsAccount = "$env:userdomain\$env:USERNAME"
$ServerInstance = "DynamicsNAV90"
Import-Module "$env:ProgramFiles\Microsoft Dynamics NAV\90\Service\NavAdminTool.ps1"
New-NAVServerUser -ServerInstance $ServerInstance -WindowsAccount $WindowsAccount -Verbose
New-NAVServerUserPermissionSet -ServerInstance $ServerInstance -WindowsAccount $WindowsAccount -PermissionSetId 'SUPER' -Verbose

If you want to learn more about the NAV Security System please check MSDN ‘Security and Protection

 

 

Configuration and personalization in NAV 2016

The Role Tailored Client (RTC) or Windows Client for Dynamics NAV 2016 has a different Role Center for each type of User. Everytime you start NAV this page will be your ‘starting point’. For example, if a user has the Profile ‘Order Processor’ then he or she will see the ‘Order Processor’ role center. So the interface is RoleTailored to the user as much as possible.  This Role Center reflects his/her tasks, views and priorities. It’s possible however to change the default ‘look and feel’ by customizing the Role Center. You could for example hide or display elements in your NAV ribbon or change the visibility of fields, actions, factboxes or fasttabs. By default personalization is enabled. It’s possible to disable personalization by adding the -disablepersonalization parameter. Example:

"C:\Program Files (x86)\Microsoft Dynamics NAV\90\RoleTailored Client\Microsoft.Dynamics.Nav.Client.exe" -disablepersonalization

Note: if you disable personalization it’s still possible to change the width of your columns for example. These settings are saved locally to ‘PersonalizationStore.xml’. This file can be found in the Appdata folder, example: ‘C:\Users\YourUsername\AppData\Roaming\Microsoft\Microsoft Dynamics NAV’. In  NAV 2009 the column width was stored in a ZUP file.

Besides user personalization it’s also possible to use the ‘Configuration Mode’. Configuration Mode allows configuration for a NAV Profile. So after customizing a profile the changes will affect all users who are assigned to this profile. This ‘base layer’ of customizations could then be personalized by the user. But it’s also possible to prevent this so your users can’t personalize NAV. This way you could protect users from their selves and assure that all users of a certain profile see the same buttons, field etc. This could ease support tasks for example.

In order to work in configuration mode to customize a profile you need to specify the parameter -configure. Example:

"C:\Program Files (x86)\Microsoft Dynamics NAV\90\RoleTailored Client\Microsoft.Dynamics.Nav.Client.exe" -configure

For more information you could also visit MSDN ‘How to: Open Microsoft Dynamics NAV in Configuration Mode

Another way to disable profile personalization for users: Go to: Departments/IT Management/RoleTailored Client/Profiles. Next, select the Disable Personalization checkbox for the profile you want to disable personalization.

Disable Personalization

Physical Database Structure of a Dynamics NAV SQL database

A Microsoft Dynamics SQL database consists at least out of three files:

– MDF File
– NDF File
– LDF File

The MDF file is the master data file and holds all the information for the other files that make up the database. The recommended file extension for MDF files is .mdf Windows Server 2012 R2 will automatically recognize this file as the ‘primary data file’ if you have installed SQL Server 2016.

The NDF file is the non-data file and holds all the information. The recommended file extension for NDF files is .ndf Windows Server 2012 R2 will automatically recognize this file as the ‘secondary data file’ if you have installed SQL Server 2016.

The LDF file is the log data file and saves transactions. The recommended file extension for LDF files is .ldf Windows Server 2012 R2 will automatically recognize this file as the ‘log data file’ if you have installed SQL Server 2016.

You could use more LDF or NDF Files and assign each one to another disk to improve your database performance.

An example:

nav-database-files

Interesting to see that since the introduction of NAV 2016 the Cronus database now consists out of just 2 files. One data file (.mdf) and one logfile (.ldf). There are no obvious reasons anymore to use three files? In previous versions at least three files were used because of legacy reasons I think. By default SQL Server itself is also using just 2 files by default.

So I did a little bit of research and created a new NAV 2016 database from the Development Environment. The result? The traditional structure: 1 MDF, 1 NDF and 1 LDF file…

Please note: if you create multiple NDF files via the Development Environment it’s always best to put every file on a separate physical disk if possible. If that’s not possible please always try to put at least the Log Datafile on a different disk. This improves the performance for SQL’s mechanism ‘Write-Ahead Logging’ (WAL) I’m referring to this Wikipedia article which describes this important feature of SQL. On MSDN there’s also a nice article about ‘Write Ahead Transaction Logging’.

How to create an NAV Serviceaccount

During the Setup of Dynamics NAV 2016 you are asked to provide a username and password of the NAV serviceaccount. If you don’t specify an account then ‘NETWORK SERVICE’ will be used. This is a local Built-in account.

If SQL Server is running on the same machine (a two tier setup) as the NST (NAV Service Tier) you could get NAV working also. Just grant the NETWORK SERVICE account db_owner permissions to the NAV database. If SQL Server is running on a different server (a three tier setup) you can’t grant permission to Local Builtin ‘NETWORK SERVICE’ account on the NAV machine. In order to accomplish this task you need to assign a serviceaccount to your NAV Service Tier. The following configuration is needed for the serviceaccount:

  • Create a ‘Domain User’ in your AD. You can do this for example on your ‘Domain Controller’.
  • Enable the account to log in as a service on the NAV server
  • Enable the account to register an SPN
  • Give the account necessary database privileges in SQL server

How to Grant the ‘Log on as service’ permission:
Start the ‘Local Group Policy Editor’ on your NAV server. Go to Local Computer Policy > Computer Configuration > Windows Settings > Security Settings > Local Policies > User Rights Assignment and select ‘Log on as a service’.

Log On As A Service

For standard usage of NAV no additional NTFS permissions are needed.

Dynamics NAV 2016 Architecture

Microsoft Dynamics NAV 2016 has been built on a three tier architecture. Using this architecture provides scalability and flexibility. The three tier architecture consist of the following::

– Data tier
– Service tier (middle tier)
– Client tier

Each tier should be installed on a separate server but for demonstration or development purposes you could install them all on one server.

The data tier consists of Microsoft SQL Server 2012 or higher with a Dynamics NAV database. For NAV 2016 you need to have at least SQL 2012 or newer. The data tier stores all the business data.

The service tier is in fact a multithreaded Windows Service which is running as Microsoft Dynamics Server. We also call this the ‘NST’ which is an abbreviation for ‘NAV Service Tier’. The service tier handles all the authentication, business logic en communication and provides caching. The Service Tier requires at least Windows Server 2012 R2 as an OS.

The client tier provides a frontend for the users so that they can work within NAV. NAV 2016 provides several clients you could work with. For example: we have a Windows Client, Web Client, Tablet Client and a Universal Client.

The 3 tier architecture in a ‘simple’ diagram:

3 Tier Architecture Dynamics NAV

New 64 bits Dynamics NAV Client!

Since the introduction of NAV 2016 the Windows Client is now also 64 bit just like the NAV Server. When you install the ‘Role Tailored Client’ from the NAV DVD you will now get 2 Windows Client executables:

  • 32 bits version: C:\Program Files (x86)\Microsoft Dynamics NAV\90\RoleTailored Client\Microsoft.Dynamics.Nav.Client.exe

Use this client if your NAV partner is using 32 bit COM or .NET Components or of course if your system OS and hardware is still 32 bits…

  • 64 bits version: C:\Program Files (x86)\Microsoft Dynamics NAV\90\RoleTailored Client\Microsoft.Dynamics.Nav.Client.x86.exe

If your OS is 64 bits then the 64 bits Windows Client will start by default. It’s obvious of course that the 64 bits client is the preferred client to use in order to utilize more memory (more than 4096 MB) for heavy reports for example.

NAV 2016 Administration Shell shortcut is missing

When you perform an installation of Microsoft Dynamics NAV 2016 depending on the choices you make during setup the following shortcuts will be created:

  • Dynamics NAV 2016 Administration
  • Dynamics NAV 2016 Administration Shell
  • Dynamics NAV 2016 Development Environment
  • Dynamics NAV 2016 Development Shell
  • Dynamics NAV 2016

These will be created in C:\ProgramData\Microsoft\Windows\Start Menu\Programs

However, the shortcut ‘Dynamics NAV 2016 Administration Shell’ will be installed in ‘C:\Users\Username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs’

So if you login as another user you won’t find this Shortcut in your Start Menu. One workaround is to manually create the shortcut:

Create a shortcut en refer to: C:\Windows\system32\WindowsPowerShell\v1.0\PowerShell.exe -NoExit -ExecutionPolicy RemoteSigned ” & ‘ C:\Program Files\Microsoft Dynamics NAV\90\Service\NavAdminTool.ps1 ‘ ”

A better solution would be to move ‘Dynamics NAV 2016 Administration Shell’ to the correct corresponding folder or of course if Microsoft does this already by design for you?

NAV 2016 Object types

The following objects exist in Microsoft Dynamics NAV:

Table: describes how data is stored in the database.
Page: displays for example tabular data so users can create, read, update or delete records.
Report: prints information or manipulates data via so called processing-only reports.
Codeunit: an organized unit of code that can be reused by other object types.
Query: defines a relational datamodel for direct querying trough OData for example.
XMLport: with an XMLport you can import and export data in plaintext or XML.
MenuSuite: the MenuSuite describes how the menus should be displayed in the Windows Client.

With the Object Designer which is part of the Development Environment you are able to create, edit, delete or modify NAV objects. Please bear in mind that your license is probably preventing you to modify certain objects and other ‘Development’ tasks.

Table Field Groups: Dropdown and Brick

A table can optionally have Field Groups. In NAV 2016 you have two types of Field Groups:

– Dropdown: determines which fields will be displayed when a table lookup will occur in the Windows Client
– Brick: the layout will change dynamically based on the type of device you are using (tablet client, phone client, web client). Want to know more? Please check the MSDN at https://msdn.microsoft.com/en-us/library/mt299400(v=nav.90).aspx

When there are no Field Groups defined, the first two fields of the primary key will be displayed and the first text field when the table will be ‘looked up’ in a DropDown.