Wednesday, May 18, 2016

How Many Lines Can be Added In Between Records?

In my previous blog post I have discuss about AutoSplitKey function in Dynamics NAV. If you have missed that click here to open the previous blog post. 

I ended my previous blog post with a question and hope at least some of you have try and tested your answer in Dynamics NAV development. If not I will give you the correct answer to it. 

Let's just see a practical example of it using "Sales Line" table. 

As shown in the above image Dynamics NAV comes to a stage where system cannot be able to auto split the key for you. 

Let's now check what is the system limitation and logic behind it. 
Following is the sales line which used for previous example. As in shown in the previous image system does not allow users to enter any additional line between Line No. 10000 and Line No. 20000. To find out how many lines can be added and how the line is been split, I have copied the sales line to an excel. Please refer the below image. 
As you can see Dynamics NAV allows you to insert lines between two existing records and maximum no of lines you can add is 13. 

Reason for that is Line No. is the auto split field and since it is a integer variable, it cannot hold any decimal values. As you enter a record between Line No. 10000 and Line No. 20000; system will create a record and assign a Line No. 15000 to it. This goes to the point where Dynamics NAV could not create a new number in the integer level. 

Hope you have got the logic behind the AutoSplitKey and its limitations. 

Please provide your feedback with a comment. 
Thank you and Regards,
Tharanga Chandrasekara


  1. Really nice article. I am new in NAV topic so thanks for sharing your knowledge on this solution :)