Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Serial numbers on reports

Posted on by Microsoft Employee

When there is one or more serial numbers on an order line, how can these be placed on/in report 1306?

*This post is locked for comments

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Serial numbers on reports

    Yes you can do this but the logic varies based on which report you want to print. If you are looking on sales invoice then you can add a new function to get serial no for each sales invoice line and insert into a temporary comment line table. the sample code looks like below, you need to call this function for every invoice line and then add a integer dataitem and loop through the tempsalescommentline to display the values

        

    IF TempSalesInvoiceLine.Type <> TempSalesInvoiceLine.Type::Item THEN
           EXIT;
         TempItemLedgEntry.RESET;
         TempItemLedgEntry.DELETEALL;
         InvoiceRowID := TempSalesInvoiceLine.RowID1;
         ItemTrackingMgt.RetrieveILEFromPostedInv(TempItemLedgEntry,InvoiceRowID);
         IF TempItemLedgEntry.FINDFIRST THEN
           REPEAT
             SerialLot := TempItemLedgEntry."Serial No." + ' ' + TempItemLedgEntry."Lot No.";
             Inserted := FALSE;
             IF TempSalesCommentLine.GET(TempSalesCommentLine."Document Type"::"Posted Invoice",TempSalesInvoiceLine."Document No.",
             TempSalesInvoiceLine."Line No.", LineNo) THEN BEGIN
               IF MAXSTRLEN(TempSalesCommentLine.Comment) >=
                  STRLEN(TempSalesCommentLine.Comment + SerialLot ) + 1 THEN BEGIN
                  TempSalesCommentLine.Comment += ',' + SerialLot;
                  TempSalesCommentLine.MODIFY;
                 Inserted := TRUE;
               END;
             END;
             IF NOT Inserted THEN BEGIN
               LineNo += 10000;
               TempSalesCommentLine.INIT;
               TempSalesCommentLine."Document Type" := TempSalesCommentLine."Document Type"::"Posted Invoice";
               TempSalesCommentLine."No." := TempSalesInvoiceLine."Document No.";
               TempSalesCommentLine."Document Line No." := TempSalesInvoiceLine."Line No.";
               TempSalesCommentLine."Line No." := LineNo;
               TempSalesCommentLine.Comment := TempSalesCommentLine.Comment + SerialLot;
               TempSalesCommentLine.INSERT;
             END;
           UNTIL TempItemLedgEntry.NEXT = 0;

  • Suggested answer
    Jan Veenendaal Profile Picture
    Jan Veenendaal 510 on at
    RE: Serial numbers on reports

    Hi,

    I havtn't done this in the mini-reports, yet, but you probable need to:

    (1) add an extra  'Integer' dataitem for the (temporary) Item Tracking Lines, indented 1 level under the order line dataitem

    (2) add  code to the report, in OnAfterGetRecord of the order line, to populate the temporary table, and in the new dataitem to retrieve these records in the right order,

    (3) add the s/n field as a column to the report dataset

    (4) add the s/n field to the report layout.

    You may want to do some concatenation of serial numbers to get more serial no.s on a line, otherwise the report might get really long in some cases.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Serial numbers on reports

    Please add required field in report dataset desginer and also add it on requested page layout after that you can view required data in your report.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Serial numbers on reports

    On an order, we have for example one item, where there are 2 serial numbers on the item under "item tracking lines". These serial numbers that are entered here, needs to be shown on for example the invoice.

  • sanjeet Profile Picture
    sanjeet 2,205 on at
    RE: Serial numbers on reports

    Your Question is Not Clear.

  • Mohana Yadav Profile Picture
    Mohana Yadav 59,139 Super User 2024 Season 2 on at
    RE: Serial numbers on reports

    Can you be more clear with an example please?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans