Set filter on Dataport

kenlkenl Member Posts: 182
Hello,

I need to export "Sales header" and "Sales Line" data.
Users will select the sales order, then click a button to export it.

Now I have two problem:
1) How can I pass the filter to the Dataport to filter the selected Sales Header.

On the form button, when I call the dataport, I write
myDP.SetTableView(Rec);

But it doesn't work.


2) How can I "Link" the "Sales Header" and "Sales Line"? (Since no indent in dataport)


I know I can solve these two problems if I use report, but dataport is more easy to select and adjust fields.

Thanks.[/code]

Comments

  • krikikriki Member, Moderator Posts: 9,118
    1) Strange, this should work. Maybe it is because you show the table in the dataport and then strip the filters? Other way is : DATAPORT.RUNMODAL(DATAPORT::"My Dataport",TRUE or FALSE,recSalesHeaderFilters);

    2) You can't. The dataport first exports the first dataitem, then the second.
    You might save every Sales Header exported in a temptable in the dataport, and when you export the sales lines, export a line only if the header is in the temptable. This is a solution that can be slow if there are a lot of saleslines that must not be exported.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.