Monday, 13 October 2008

Creates Line No. automatically for new new record

Navision can automatically assign Line No. to a new record if the Line No. is part of the primary key fields. This can be done by setting the AutoSplitKey property in the Form to Yes. By default the AutoSplitKey property is set to No.

Let's consider the following example. When I enter a new sales line record in Sales Order form, Navision will automatically assign Line No. = 10000 to the first Sales Line record. Now, if I enter the 2nd Sales Line record, Navision will automatically assign Line No. = 20000 to the new record. If I insert a new record between the 1st and 2nd record, Navision will automatically assign Line No. = 15000 to the new record.

All this can happen because Autosplitkey property in Form 46 - Sales Line is set to Yes. In order for AutoSplitKey feature to work, the last field in the primary key must be an integer, BigInteger, GUID or decimal field. If you look at the Sale Line table, the Primary key is 'Document Type,Document No.,Line No.', where Line No. is an integer field.


Maaax said...

Thank's a lot! I'm new in Dynamics NAV (since 1 year), and that was hard for me to find the solution! I have a blog too (in french) about Nav : !

Again, thank's !

Anonymous said...

i have the same error when i click on the subform and i dont know how to solve it
please help,it is the first time i see this,i have done whole system in nav,am currently doing an insuranceh module with nav

Anonymous said...

Thx, this tip saved my life