Dataport Filter(Before export)

yukonyukon Member Posts: 361
Hi Expert,

I am exporting orders from sales eader (36) and sales line(37) to csv.
I have managed to filter the sales headers to just the order no.s,status is open, i need but i keep getting the entire sales line table!

How do i filter sales line


best regards,
yukon
Make Simple & Easy

Comments

  • SavatageSavatage Member Posts: 7,142
    as you can see the sales line have no way of knowing if a sales header is open or not using a dataport since you can't link the tables.

    You'll have to rethink the dataport to something like

    if salesheader.status = salesheader.staTUS ::OPEN:
    then do a sales line get for maybe better, find. (haven't tried)

    then assign the fields from the sales line to variables that you can then export.

    another thought would be using the write command to send data to a file.

    or a report, which you can link the tables, to export to excel using the excel buffer & then save that file to csv.
  • yukonyukon Member Posts: 361
    Hi Savatage

    Thank 4 ur reply. i found one ans at our forum http://www.mibuso.com/forum/viewtopic.php?f=23&t=5382&hilit=dataport+filter
    , like as my problem. So i try like that, but my one does not work.
    g_recSalesHeader.SETRANGE("Document Type",g_DocType);
    g_recSalesHeader.SETRANGE("No.",g_DocNo);
    
    it say we need to use copyfilter at OnPredataItem of SalesLine.
    g_recSalesLine.copyfilter("Document Type.",g_recSalesHeader."Document Type");
    g_recSalesLine.copyfilter("Document No.",g_recSalesHeader."No.");
    

    What wrong at my code.

    Below code is work
    OnPredataItem
    g_recSalesLine.setrange("Document Type","Document Type"::Order);
    g_recSalesLine.setrange("Document No.",'0001');
    
    Make Simple & Easy
Sign In or Register to comment.