Dynamics NAV 2015 and Windows 10

//UPDATE: MS promised to fix everything in October hotfix! http://blogs.msdn.com/b/nav/archive/2015/08/20/windows-10-and-dynamics-nav.aspx

Also I need to add that if you install NAV on windows 8.1 and then upgrade to windows 10 – everything works, including web server components and help server. Fails on fresh install, though!


So, as you can see it works! Windows 10 build 10162 and NAV2015 build 8.0.37874.0.


Yeah, NAV2015 windows client and server can be installed and run on Windows 10. But, unfortunately not everything works. I am struggling to make live Help Server and Web Server for NAV 2015, it seems to me that MS have done something to IIS in Windows 10, so it is not compatible to NAV 2015 anymore. The error I am getting is the following:

Microsoft Dynamics NAV Build 37874
Error Report
Setup Components
The component was rolled back.
Microsoft IIS URL Rewrite Module
Microsoft IIS URL Rewrite Module (64-bit)
Fatal error during installation.

Microsoft IIS URL Rewrite Module Error

No idea what it is, tried to google, but not a big success.

Anyways, I’ll report this to MS and we will see what will happens in future builds.



Timestamp and NAV 2015

Doing an integration work I’ve created a new table. I’ve decided to keep filed names as they come in inbound XML file, just to keep things simple. Ok, it is against the MS naming conventions, but no people will look into this intermediate table, so i decide to go this way.

And know what, I’ve get trapped almost immediately. My inbound XML file had a field named ‘timestamp’.

Guess what I got?

This one:


Ok, it is clear that any SQL table (and NAV tables are SQL tables) already have column named ‘timestamp’

So, stick to MS naming conventions and you won’t be in trouble :).

Record Link and Notification in NAV 2013R2.

Yeah, no posts for a long time. The reason is simple. I am currently working for a customer on 2009SP1, classic. There is nothing to post about…

But, earlier this year I have had a customer request, when customer wanted some notifications to be created, triggered by NAS. Ok, sound simple, say the condition met and all we need is to insert a text into ‘Note’ field of a ‘Record Link’ table.

There is even a standard code to do so (can be found in the codeunit 454 ‘Job Queue – Send Notification’, local function ‘SetText’. What can be easier?

All coding has been done in little time, matter of hours, but initial testing revealed that the notification text is truncated. Even more, some messages were all right, but some badly truncated…

I’ve tried everything. But, the answer was simple – wrong build. I was on 7.1.36366.0. I’ve upgraded my installation to 7.1.40076.0 – and problem gone. All my truncated notes now looks just fine.

Another reason to keep everything updated!


NAV 2013, NAV 2015 RDLC Reports – Font size issue.

As you probably know, it is fairly easy to use HTML formatting on RDLC report controls. Sometimes it is quite useful, especially for things like footers or so, when you need to put something like company details in strictly formatted way, using different fonts and colors for single line of text, like: ‘NAV Workshop LTD Registered address: XXXXXXXX, ZZZZZZZZZ, Warwickshire, United Kingdom’, Company No: 900000′.  Of course, this can be accomplished by creating a separate text box for each formatting, but it is a bit of overkill. HTML formatting like

<span style="font-size: 8pt;"><span style="color: #003366;"><strong>NAV Workshop LTD</strong></span> Registered address</span>: <span style="font-size: 8pt;"><strong>XXXXXXXX, ZZZZZZZZZ, Warwickshire</strong>,</span> <span style="font-size: 8pt;">United Kingdom, Company No:<strong> 900000. </strong></span>

will easily do a trick.

Where the issue then? In code example above there is no issues, but if you use something like

<span style="font-size: Medium"><span style="color: #003366;"><strong>NAV Workshop LTD</strong></span>

– then you re in trouble. Although it is fine to use relative font-size on HTML, but just don’t do it on RDLC reports HTML, as it will be rendered differently on different machines. Just use strict font-size.

Payment Terms, Payment Method and Payment Discounts

In Dynamics NAV 2015 (and in older versions too) we do have a functionality to define payment terms and payment methods. The difference between two is that Payment Terms define WHEN we want money in, and Payment Method define HOW we want money in.
Pretty simple, and it is hard to find a NAV Consultant, who is unfamiliar with this.

But, I’ve managed to find a flaw in this well-known and reliable stuff. Say you define a Payment Terms of 1M(8D) which will mean, that we want money in in 1 month, but will grant an payment discount if customer pay within 8 days. Fine till this point – quite realistic scenario. Then we define a number of payment methods, including CASH, and for cash we put a Bal. Account. This is fine too – when you post an invoice system will automatically post an balancing entry, indicating that payment is received. Exactly what you expect when you take a cash and put it to your cashbox :).

But what if customer’s payment terms defaulted to earlier mentioned 1M(8D)? Well, here we got an issue. The system will automatically grant a payment discount, as you’ve just posted a payment transaction with same date as on your invoice. So in result we will have a payment discount granted, and in all our ledgers the payment amount will be reduced by discount amount, and system will say no single word about this until you navigate on posted document and check you ledgers…

In my opinion this behaviour is entirely wrong for cash based transactions. Well, I know, the payment discounts isn’t a very popular stuff, but as long it is here it worth to check if you customer got payment discount, and just disable it if you going to take cash.

Backup, Restore and Record Link – NAV 2009 R2

Yeah, i know, 2009 is an old one, but it still alive, despite not supported by Microsoft.

Well, we still have a customer, who run NAV 2009 R2, and colleague of mine came across interesting issue: customer reported they lost all records in Record Link table. After some investigation it turned out that they had intention to create a test company – which lead they to the problem.

So, what they did? They took a native NAV backup, then renamed existing company, then restored a backup to bring live company back. Boom! No Record Links anymore!

I am not surprised – Record Link table has ‘data per company = no’ and a primary key ‘Link ID’ .  ‘Company’ field with relation to ‘company.name’ isn’t part of key…

When you made a backup and then rename company ‘A’ to company ‘B’ system will update only ‘company‘ field in the record link table. Then when you restore original company ‘A’ backup if you include data common to all companies – system will not overwrite Record Link table – it will just skip records with same ID (and PK isn’t changed, you see!) .

So, how to solve then? The answer is simple: just a line of code:
RecordLink.Modyfyall(Company, ‘A’) 
assuming there was only one company before.

Yeah, this solve the problem, but what we can do to avoid the issue when we want a test company in old good NAV 2009 R2? My common sense tell me that there is a simple way to avoid that sort of issues.

1. Make a company A backup
2. Restore to clean DB
3. Rename restored to new name (B)
4. Take a backup
5. Restore taken backup to live DB, which will create exact copy of A company with name B.

Of course, test company B will not have a Record Links, as they had same ID, therefore not overwritten, but company still A in Record Link table.

Seems like design flaw in 2009 – but do we care about this? More interesting: it is the same Record Link table structure in latest versions. OK, we can’t copy company in NAV 2013, but can in NAV 2013 R2 and NAV 2015. I’ll investigate and report later how this behave in modern NAV.

Dynamics NAV 2015 and Windows 8.1 (Not PRO)

I’ts turned out that you can’t install Dynamics NAV 2015 web client components on Windows 8.1 not PRO edition. The bloody thing does not  support Windows Active Directory, so can’t enable windows authentication for IIS, which is prerequisite fro WEB client. So, MSFT just made another £100 of me 🙂 Yeah, upgrade to PRO costs just £100.

So, buying a new laptop – check what version of windows is installed on it!

Dynamics NAV and SQL Linked tables

While fiddling with my dozens of linked tables I’ve came across an interesting issue.

I’ve got a table with simple primary key (field 1). 1. This table is connected to SQL View, and the View is pointing to SQL Table. When I run some code against data in my table I’ve identified that there is number of records with same primary key! Well, it is not something you can see in NAV world.

I did some investigation on this, and found, that my SQL table (which wasn’t created by me, but provided by third-party organisation) has no primary key on it, therefore it is fine to have duplicate values in any (or even all fields) for some (or even all) records.

It seems Dynamics NAV Linked tables can’t handle this situation properly. Well, when you define any table in NAV it has to have a primary key, and you will expect it to be unique.  But not for a linked tables. Linked tables inherits the schema defined in the SQL side, so it may have non-unique values in your primary key field.

I’ve tried to reproduce the issue – and have done it quite successfully, please have a look to pictures below:

  1. NAV table structure and Primary Key
  2. SQL table Definition
  3. Data I’ve put to SQL table
  4. Data I can see in NAV system

So, what we can do to resolve this? In ideal world we should always have same primary key in SQL table and NAV linked table. In real life it may be difficult (you may have no right to alter tables provided by third-party organisations) – so if you unable to alter SQL table – then you have to handle this on NAV side by code… Of course, I would prefer to keep same keys on both sides, in Dynamics NAV and in SQL.

RDLC Reports and images in Dynamics NAV2013 / NAV2015

Recently came across an issue – NAV Windows Client crashes when report 206 (Sales Invoice) is run on massive number of records. After some investigation I’ve found that middle-tier and windows client consuming huge amount of RAM. Well, the reason was simple – someone put an 4MB image to company information. By design all standard reports (if has image) send the BASE64 representation of image with each dataset line (see Fig. 1). Of course, if we got say 500 records and 4Mb image – this will come to 2gb, which is memory limit for 32bit NAV Windows Client. So no surprise it crashes… Of course, we can use smaller image, which i did, but even 300kb image multiplied by thousands of dataset lines will create issue. And after all – it is just stupid to send static data with every line – nothing stop us to clean-up dataset. So the solition is as per Fig. 2. And result is Fig. 3. So then dataset will have image populated only for first document dataset lines – which will dramatically reduce dataset size and improve report performance.


Fig 1.


Fig. 2


Fig. 3

Convert SQL Script to Dynamics NAV table Text Object

Got a task – need to create dozens of SQL-NAV linked tables, and some of them have hundreds of fields. Boring and stupid work 🙂 So I’ve  made  a tool to convert SQL scripts to Dynamics NAV NAV text objects.

You can download stuff here. Provided with no warranty, free to distribute and amend (retaining a copyright).