txt import by DataPort

Hi, I’m using Dataport to import orders(txt- multiple lines) to Sales Line. Imported fields are; Document type, Document No, Line No, Type, No, quantity and planned delivery date. I use the salesline.validate(No.) in OnAfterImportRec to fill in the rest of the fields. Does anybody know how to use the no. series made by navision for the Line no? Is it possible? I’m also having trouble with setting the imported delivery date. Looks like the date from Sales Header is beeing used…[:(] TIA

The Navision No. Series Management bases on Code20 fields. Line No.'s are integer so there is no point in using this functionality. I guess you will need to increment your line numbers manually. Anyway as you are importing the line no. already, where is your point ?

quote:

…trouble with setting the imported delivery date. Looks like the date from Sales Header is beeing used…

If you study the “No.” field OnValidate trigger, you will see that the current record values are saved in ‘TempSalesLine’ and then the entire record is INIT’ed. Then only the Type, No. and Quantity are copied back to the current record from the TempSalesLine. The rest of the fields are set from their ‘default’ location (mostly from the SalesHeader). To preserve the “Planned Delivery Date”, save it to a local variable before you call VALIDATE(“No.”) in the OnAfterImportRec trigger. Then after the VALIDATE(“No.”), restore the “Planned Delivery Date” (? and VALIDATE it ?).

Thank you for your answers:) And Thomas, my point of wanting to use automatic made lineno is that I don’t have any way to know for sure that the lineno imported is uniq(and doesn’t make my function to crash). Actually, to make this work I had to disable the imported lineno and increment the line no manually as U said. I just hoped I didn’t have to do this… sorry for my lousy explaining…:frowning: