NoSeriesMgt, Looping

I am writing a routine in a Report. It is opening and reading a text file and, for each text line, creating a Purchase Header record. In order to use the proper No. Series, I’m doing an: PurchaseHeader.INSERT(TRUE) This works for the first INSERT in the loop. But for subsequent INSERT attempts, the Header No. is not being incremented. What’s the best way to handle this? Thanks in advance.

Try this:- PurchaseHeader.“No.” := ‘’; PurchaseHeader.Insert(TRUE); … //Updated other fileds now PurchaseHeader.MODIFY;

FYI: As far as I can see problem with your code is that you are not clearing the PurchaseHeader Variable. So after the first insert, Your “No.” field is not blank, so its not inserting the new no. So in Other Words within the loop if you write CLEAR(PurchaseHeader); Before all code, then you shoul be fine. Naveen Jain

That’s it! Thank you very much.