I created a little holding table in Navision and I’m having trouble added records to it as it keeps creating a Key field on my first field which can contain duplicates. This table doesn’t need any key fields as it’s just a bunch of text fields to run a report out of.
I made a combination Key field to get it to work but I still would rather not have a Key field. It’s possible I could get a duplicate combination field in the future.
Maybe you want to add an integer field as primary key as in the entry tables. If you add a new record search for the last one inserted, increase the integer by one and insert the new record with your information fields.
Another way of doing this is to create an Integer-field to be Primary-key (LineNo). Maybe you make it non-editable at table-level. And then your text-fields, of course.
Now - on your form, set form-property AutoSplitKey to Yes. Do not insert the integer-field into the form at all. And perhaps yopu set form-property DelayedInsert to Yes.
Doing it this way Navision automatically will assign your primary key as you insert new lines - just like in jounal tables.
If you insert records via coding you have to assign the primary key manually (Last LineNo += 10000).