Sales Sub Line

Hi, need some help on this one. I need to find a trigger what gives me the ‘Line No.’ if I’m creating a new SalesLine, with form property: DelayedInsert = True. The problem what I have is that Navision doesn’t have the ‘Line No.’ available at the time that you create a new salesline with Delayed insert = true. The line will only be created if you go to the next line. I need the lineNo field in order to create a Subline, attached to the salesline. I tried triggers in the SalesLine form aswell. Just nothing works. Please help. Thanks, Roelof de Jong.

Hi Roelof, How about inserting your subline with LineNo := 0. Then You just have to modify your subline on the insert- and modify-triggers on the Sales Line table. regards Alexander

Hi Roelof, Have you considered to use currForm.SAVERECORD before calling your subform?

here is the answer to this problem. I’d figure i’d post it here in case someone else has the same/silimar question…

quote:

[“fb”]The following triggers can ‘see’ the new Line No:
[]Sales Order Subform – OnInsertRecord []Sales Line Table – OnInsert
If you add code to the form’s OnInsertRecord trigger, be sure to EXIT(TRUE) if you want the usual insert behavior to continue. Otherwise, the form will assume that you have inserted the record on your own.

quote:

[“Roelof”]Hi FB, You are awesome. That did the trick. I wish we as Navision programmers could update our skills with tips and tricks like this. There are actually so many things we just don’t know. Thanks again! Kind regards, Roelof de Jong.