SalesLine Line No.

Hi, Can someone help me with the following problem: When I enter a new salesline on a SalesOrder, the LineNo. is not being created yet. I need this lineNo. because it will be part of a key on a linked table. This linked table to the SalesLine Table contains records which are being created when I am entering this new SalesLine record. Does anyone have suggestions?

On the salesline form the property DelayedInsert is set to yes.

I did that but that didnt solve my problem. First of all you need to put this LineNo. field on the subform (and make it non-editable, because otherwise users might enter a value). Second is that you are now able to create a lot of blank lines, which I dont want. Is there not another solution?

There are several possibilities: 1) On the subform the DelayedInsert Property must be set to NO. On the salesline table, AutoSplitKey must be set to yes. If you want to avoid that the user can create blank lines, you can make a field in the Salesline mandatory. For example the Item-No. However I do not recommend that as you wouldn’t have the possibility anymore to enter free text. 2) If you don’t want to use AutoSplitKey, you can create your own “CreateLineNo” routine which is being called on Salesline … * OnInsert * OnModify * Call of the linked table. In any case the statement should look like: If LineNo = 0 then CreateLineNo; 3) If the link to the subform is established on the SalesLine Form, you can force the creation of the LineNo prior to call the linked form. Such as: LinkButton.OnPush If LineNo = 0 Then Currform.Saverecord – or – If LineNo = 0 then exit; – or – If LineNo = 0 then Begin CreateLineNo; Modify; Commit End; Hope this helps. Marcus Marcus Fabian phone: +41 79 4397872 private: biz:

Hi All you need to do is to save the record then the “Line No.” will be populated. Say after the “No.” Field is populated add some code on the form textbox OnAfterValidate trigger IF “No.” <> ‘’ then CurrForm.SaveRecord; Or if you have FlowFields then use IF “No.” <> ‘’ then CurrForm.UPDATE(TRUE); Mr David Cox MindSource (UK) Limited Navision Solutions Partner Email: Web:

Thanks all, for your help. I think this’ll work.