XMLport - filter sales line using sales header field.


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


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.

1. Blank row gets created in csv for every header record.

2. only last header's line information only show in csv.

Please advice.