Currently I’m upgrading a customer from NAV2015 to NAV2017.
During the implementation of NAV2015 the customer has asked me, I they could design there reports themselfs.
And my reflection was, why not.
So as said the customer changed there report layout within NAV with the feature “Custom Layouts”.
A new feature back in NAV2015 but still available in NAV2017.
Now during the upgrade of this customer I ran into some issues when testing the upgraded version.
Every time I try to print a report with a custom layout NAV crashes with no more information.
After troubleshooting the layouts i found the cause of this behavior.
During the upgrade process of code the PowerShell cmdlets upgraded the reports without error.
So as you can see the system added a new field in the dataset of the report. Nothing special.
But in combination with the custom layouts there is a problem.
The custom layout didn’t have the new field in the dataset and that is the reason for crashing NAV.
To fix this I thought to use the upgrade codeunit 104060 “Report Layout Upgrades”. Which is used during the data migration from NAV2015 to NAV2017.
As you can see there is some example code to replace or delete fields.
But the one I need is the add function. And that one is missing.
The only way to fix this issue, is to open every custom layout in NAV, don’t change anything in the report itself and save it in NAV. In the background NAV generate the custom layout with the new dataset.
And from then the new fields are also added to the custom layout and NAV don’t crashes anymore.
I hope Microsoft will fix this in the (near) future, so that we don’t lose much time when upgrading custom layouts.