I have created an XMLport which should export Posted Sales invoice lines in CSV format. the invoice lines should be filtered using salesperson code from the header table.
I have kept only sales Invoice line dataitem(node) and filtered the lines using below code in onaftergettrigger.
IF SalesInvoiceHeader.“Sales Person Code” <> ‘FH’ THEN
Currxmlport.SKIP;
The above code works fine. but it takes long time to run the xmlport due to huge no of records in sales invocie line table.
If I add new sales invoice header dataitem(node) and make it as parent to sales invoice line dataitem and filter the header row using tableview property I face two issues.
Blank row gets created in csv for every header record.
only last header’s line information only show in csv.
Do you only have Sales Invoice Line as a dataitem in the xmlport? If yes, then you have alot of lines then of course it will take a looot of time, as you will have to read all lines first.
If you add sales invoice header to the dataset, then you will be able to filter on the salesperson code directly in the header. And the you would link the headers and lines. That would change it so that only the correct sales lines are read from the database.