Step 1 – Renumbering | ForNAV App Building

Ok, so as I wrote earlier this week I have been asked to build an App for ForNAV to provide with a set of “superior” reports that work optimized with the designer.

To do that I first build a prototype based on an initial interview and the prototype was approved. You can find the prototype on GitHub and run the reports in a NAV2017 database using the free download on www.ForNAV.com.

ForNAVGitHub

Renumbering

The prototype was created in the 84xxx series which is more like a trip down to memory lane for me as this was the range I build my first large ISV solution in.

Now we need to renumber it to our ForNAV range which is strangely enough 6188471 – 6189470. No, it’s not a joke and it will take me a while to learn these numbers by heart.

Our options

Now what options do we have or which tools can we use. I’ve actually listed a few with pro’s and con’s

1. Notepad

If you know what you are doing you can renumber in notepad, and I typically do that if I have a few objects and the renumbering is a one-time job.

In this case I don’t want to use notepad since I have quite a few objects and my objects are reports which use the RDLData section which might accidentally contain the same integer values.

2. The good old classic

Since as long as I remember I’ve used the classic renumbering tool from a classic database. Your database only has to be 1000kb and with a small tweak it also renumbers pages.

Compare1

I would have used this tool if it would also renumber my fields but it does not do that. Let’s move to the next option.

3. Objects4NAV with DotNET power

Gunnar Gestsson has created a variant for the three-tier environment and loaded it with DotNET power. You can download and read about it here.

It seems like a good option and the suggested ID feature is quite nice since it will look at your license and check for available objects. Neat.

Compare2

Unfortunately it also does not renumber my fields.

4. PowerShell

Since a few weeks we have a new option. Microsoft (Freddy Kistiansen) created a renumber tool which can be used in PowerShell or from the Dos Command line.

To install this tool you need to have some knowledge of Visual Studio since the dll is not provided, you have to create it yourself. I think this will prevent some to use it in our NAV ecosystem.

After you’ve downloaded the files from the GitHub you can use the compiled DLL in PowerShell but it took me a few moments to get my head around the script and I’ve actually made a small change to make more sense to me.

PowerShellRenumber

  1. This line loads the C# code into memory of PowerShell
  2. Create an empty array
  3. 0..999 means FOR 1 TO 1000 in C/AL terminology. The pipe sign means to create a list of numbers to use. In my case I want to renumber 84000 with 6188471, 84001 with 6188472 and so on.
  4. This calls the actual renumbering

This script, once you get it working, has some advantages. First of all it will also renumber any fields you have used but it will also renumber WebService definitions, Delta files and the new AL format for VSCode.

So this is my choice and even though automation is not one of my requirements I am going to keep this script and you can find it together with the DLL on my own GitHub.


Related
Recommended