Copy Result of SetFilter to temp table (or other structure)

markclemarkcle Member Posts: 50
Hi All

I need to filter sales lines by a number of attributes and make a copy before I update the selected lines. After updating the original; sales lines, I need to compare the updated values with the original ones:

So
                SalesLine.SETRANGE("Document Type", SalesLine."Document Type"::Order);             
                SalesLine.SETRANGE(Type, SalesLine.Type::Item);
                SalesLine.SetFilter("No.", '= %1', SourceItemNo);
                SalesLine.SetFilter("Blanket Order No.", '= %1', BlanketSalesLine."Document No.");
                SalesLine.SetFilter("Blanket Order Line No.", '= %1', BlanketSalesLine."Line No.");
                SalesLine.SetFilter("No.", '= %1', SourceItemNo);
                SalesLine.SetFilter("Quantity Shipped", '= 0');

                // take a copy of these (in a temp table?) - STUCK HERE

                // repeat until over filtered sales lines

                // compare COPY of original lines with data in update lines

How can I make a copy of the filtered lines? (I don't actually need all the fields, but there will only be a max of about 100 records)

Thanks

Mark

Answers

  • AlexeyShaminAlexeyShamin Member Posts: 67
    try this one for copy
    Variable CopySalesLine - temp Sales Line record

    if SalesLine.findset then
    repeat
    CopySalesLine.Copy(SalesLine);
    CopySalesLine.INSERT
    until SalesLine.next = 0;
Sign In or Register to comment.