How to only display SINGLE LINE sales orders on a report

johnsogjjohnsogj Member Posts: 103
Hello, I'm creating a pick list from the "Warehouse Activity Line" table and I only want to include SINGLE LINE sales orders. So basically, the report should look in the "warehouse activity line" table and before it writes a record it should check to see if there are any other detail lines for the same sales order in the table. if there are not, it should print that line (so that it can be picked). If there are additional detail lines for that same sales order, then no lines for the order should be printed.

can anyone help?

Comments

  • SavatageSavatage Member Posts: 7,142
    trying to understand but it's not easy by your desription

    but

    if i only wanted the first line i would filter on line no 10000
  • idiotidiot Member Posts: 651
    Try the effect of SalesLine.COUNT = 1 & see if it achieves your purpose.
    NAV - Norton Anti Virus

    ERP Consultant (not just Navision) & Navision challenger
  • johnsogjjohnsogj Member Posts: 103
    how would the code look to only count specific records in a table? I understand how to use COUNT to count all records in a table, but how do you write the code to count the number of records in the warehouse activity line that have the same value in the "Source No." field as the current record?

    thanks for your help. I think this just may work.
  • johnsogjjohnsogj Member Posts: 103
    harry - the reason I cant filter for only records where line = 1.000 is because then I would still be printing line #1 for a multi-line sales order. I only want to print lines for sales orders that have ONLY 1 line. if an order has more than one line I want to skip the entire order.
  • idiotidiot Member Posts: 651
    Savatage wrote:
    trying to understand but it's not easy by your desription

    but

    if i only wanted the first line i would filter on line no 10000
    The first line might not be 10000...


    Try the following:
    The least & ugly coding (there might exist a function somewhere in some obscure codeunit that returns the number of sales lines...):
    SalesLine.SETRANGE ("Document No.", "Source No.");
    IF SalesLine.FINDFIRST AND (SalesLine.COUNT = 1) THEN .....


    Also explore SalesLine.NEXT...
    NAV - Norton Anti Virus

    ERP Consultant (not just Navision) & Navision challenger
Sign In or Register to comment.