Field Numbering in Dynamics NAV

Field Numbering in Dynamics NAV

Last Friday I received recently published “Programming Microsoft Dynamics NAV 2009” book (written by David Studebaker). Thanks Amazon for the quick delivery!

So, my Saturday morning started with a big mug of coffee and David’s book. I would not call myself a newbie anymore when it comes to Dynamics NAV development, however I decided to go through all the book page by page, chapter by chapter. After all, repetition is mother of all learning… repetition is mother of all learning… repetition is mother of all learning… repetition is mother of all learning…

The first tip (which I was already applying instinctively when developing modifications for Dynamics NAV) I found in the book “Programming Microsoft Dynamics NAV 2009” was to use gaps (incrementing “Field No.” by 10) in field numbering. For example, when you are designing a new table called “My Brand New Table”, you should not just create fields:

  • 1 Custom Field No. 1
  • 2 Custom Field No. 2
  • 3 Custom Field No. 3

It is better to use a different approach, and leave gaps between field numbers. Therefore, my table would look more like this:

  • 10 Custom Field No. 1
  • 20 Custom Field No. 2
  • 30 Custom Field No. 3

Field numbering sequence has affect on how data is sorted, and how data is moved from one record to another. Considering that it is really painful at the end of a project to start renumbering fields, as a rule of thumb, it is faster to create new fields in the gaps you have left before.

From my own experience (I am not sure if other developers do that as well), I like to leave even bigger gaps between groups of fields which belong to different projects. Then, my table would look more like this:

  • 10 Custom Field for Project 1
  • 20 Custom Field for Project 1
  • 30 Custom Field for Project 1
  • 100 Custom Field for Project 2
  • 110 Custom Field for Project 2
  • 120 Custom Field for Project 2

I am only into first 50 pages yet, but I have already found something worth thinking about. I am really looking forward to dig deeper. Let’s grab another cup of coffee…

What is your own best practise when it comes to field numbering in Dynamics NAV? Do you have your own system that would be worth sharing with others?

Technorati Tags: , ,

This entry was posted in development and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *