NAV Upgrade Notes – First essential step for a successful NAV upgrade

Standard

The first step in my last NAV upgrade was to back up customized tables. Although having database backups throughout your upgrade process is a no brainer, my focus in this post is backing up locally tables that contain non-standard fields. Having the heavy customized tables readily available in the same database, somewhere in the range 50000-99999 it can prove useful.

For example, let’s say the table 21 Customer Ledger Entry in my customer NAV 2009 database has a few non-standard fields in the range 50k or some other range. My plan is to have an exact copy of this table with ID 50000, table that I can carry forward until the upgrade process reaches NAV 2017.

Having the original data allows me to:

  •  re-construct any field that might have gotten lost or overriden during the upgrade (through a Forced sync without an upgrade codeunit or some other faulty process) or
  • perform conversion validation like comparing the balance for each customer in the original table(now saved in the 50k range) with the value from the upgraded table.

To backup the table I start with opening the original table (21), copy all fields, create a new table in the 50k range (60007) and paste all the fields. In the new table we don’t need any business rules, therefore we can select all code lines and delete them.

I would do the same for all tables whose data I want to back up.

If your backup set includes like mine, hundreds of tables, I would create a new table(50000) where I am planning to keep all original-backed up table pairs. For example, I can have pairs like table 21 – table 60007 in the new table:

List Of Tables

Next we need to populate the new table 60007 with original data.

Create a new codeunit and traverse table 50000. For each row execute the following function:

CopyData

This method copies the value of “Normal” fields from the source table(21) into each correspondent field from target table(60007).

Advertisements

How to use CAPTIONCLASSTRANSLATE in Dynamics NAV

Standard

Not long ago I stumbled upon a question on the popular NAV forum dynamicsuser.net. The question was “What is the use of CAPTIONCLASSTRANSLATE command in NAV?”.
There was only one answer coming from one of the most influential experts in the NAV world, Luc Van Vugt, but his answer intrigued me even more. As msdn was not very helpful, I started digging into this function use.

First, I wanted to see where is used in standard NAV 2017 in the Cronus database. To find all occurrences of CAPTIONCLASSTRANSLATE in standard NAV I used the Object Manager produced by idyn , a NAV AddOn for managing C/AL code. For my readers that do not have access to this development tool, export all objects to a text file and search in the file for “CAPTIONCLASSTRANSLATE”.

std-nav-use

First occurrence was in report 13, VAT register:

rep13

The report is using the command CAPTIONCLASSTRANSLATE to populate the value of a control(VATEntryClosedCaption) with the caption of “VAT Entry”.Closed field.

Similarly, CAPTIONCLASSTRANSLATE is used in report 22 “No. Series Check”, report 35 “Document Entries”, report 122 “Reminder – Test”, report 123 “Finance Charge Memo – Test”, report 1403 “Bank Account Register”, report 5900 “Service Order”.

A more intriguing way of using the command CAPTIONCLASSTRANSLATE is found in the other objects  as following:

employeelistreport

As we can see above, CAPTIONCLASSTRANSLATE receives a string parameter consisting of three sub-strings separated by two commas.

CAPTIONCLASSTRANSLATE(‘i,j,k’)

By investigating the code in Codeunit 42 “CaptionManagement” and Codeunit 57 “Document Totals” I could draw the following conclusions:

If i = 1 then CAPTIONCLASSTRANSLATE will output Dimension codes.

If j = 1 then CAPTIONCLASSTRANSLATE will output Global Dimensions code.

If k = 1 (i=1,j=1) then CAPTIONCLASSTRANSLATE will output “Global Dimension 1 Code”

If k = 2 (i=1,j=1) then CAPTIONCLASSTRANSLATE will output “Global Dimension 2 Code”

If i = 1 and j = 2 then CAPTIONCLASSTRANSLATE will output Shortcut Dimension Codes(for k=1..8).

dimensioncodes

For printing field captions that have (LCY) in caption use i = 101.

For example to display Amount(LCY) use CAPTIONCLASSTRANSLATE like below:

lcy

To display captions of amount fields that contain the text “Incl. VAT” or “Excl. VAT” use CAPTIONCLASSTRANSLATE with i =2 and j = 0 (to display Excl. VAT) or j = 1 (to display Incl. VAT) as in the examples below:

vat

All examples of CAPTIONCLASSTRANSLATE found in NAV standard were in reports and used to display captions in the table headers or group totals in report layouts.