manually increasing id field

Hi, i defined a group table with groupid, groupname, narrative fields.

i will create a form with disabled groupid field.

Other fields could be entered by user.

If table has no records groupid will be 1, else last groupid + 1.

firstly, is this logical? if yes, is this able to make? and if yes, how?

Best regards.


You can do this in a couple of ways - via number series management by creating a number series for this specific table or through a manual code increment when a new record is inserted, Nav code checks for the last number used.

Number series tidier!


hi, i’ve done it like below.

but is this the easiest way to do or is there any way to do easier?

because it’s very complicated for me.

Best regards.


This is the proper way to do it but there is an easier way.

Either set a trigger in the OnInsert area of your new table to find last entry on same table or add some code to the default form / page set for your new table.

Web link for screen shots below:

I would also set the form to DelayInsert and PopulateAllFields - assuming you are using Nav 2009 Classic or before. Same code will work for pages as the code sits on your new table.