Insert new record

Hi,all. I create a new table. The fields are: Document No. Line No. Item No. Quantity The key is Document No. and Line No. I generate new Line No. at form’s trigger OnNewRecord. It works well. But my problem is if user moves mouse to a new line in form, even he doesn’t key in any information, a new record is created. So this record has many blank fields. When I look up Sales Order, if I move mouse to a new Sales Line, the sign at the left of this new record is a star and a arrow. No matter which field I click, if I don’t key in any data and move to next new line, this record is not saved into table. I cannot find how Navision control this. Any idea?

Hi, Use Autosplitkey property of FORM to automatically generate the Line No.There is no need to write the code. Note: For Autosplitkey property it is necessary that Last field in Primary key of selected table must be Integer or Decimal.

Hi WWS set the following properties on the form to yes DelayedInsert- yes MultipleNewLines - yes then you will get the desired effect… cheers MK

Hi,MK, Yes, these two properties solve my problem! :slight_smile: Thanks!