Determining Item Tracking for Sales Invoice 4.0

BokkBokk Member Posts: 138
I am moving some customizations for Item Tracking (Serial No.s) in sales reports to 4.0 and the underlying tables have changed. They used to be stored in specific ledger tables (ie. Sales Shipment Item Tracking), but are now in the Item Ledger Entries table. I was able to rework the Shipment, Credit Memo and Order reports by changing the dataitem source and filtering differently. It was pretty straightforward, but the Sales Invoice does not seem to have a direct relationship based on a foreign key. I followed the application from a Posted Sales Invoice -> Line -> Item Tracking Lines and it uses codeunit 6500 to get RowIDs. I tried using this, but am running into an infinite loop.

I am working on the Sales Invoice Rpt 10074. I only added an Integer indented dataitem to the bottom with the code to retrieve the Serial No.s. The report gets the sales details in the 2nd dataitem, Sales Invoice Line and stores them in the global, TempSalesInvoiceLine to be looped through and displayed in the 6th dataitem, SalesInvLine. I used a similiar loop and called codeunit 6500 in the OnAfterGetRecord trigger to try to display the Serial No.s as follows, but am getting an infinite loop.

OnLineNumber := OnLineNumber + 1;

WITH TempSalesInvoiceLine DO BEGIN
IF OnLineNumber = 1 THEN
FIND('-')
ELSE
NEXT;
END;

IF NEXT <> 0 THEN
ItemTrackingMgt.ComposeRowID(DATABASE::"Sales Invoice Line",
0,TempSalesInvoiceLine."Document No.",'',0,TempSalesInvoiceLine."Line No.");

I need to get my report working, but am also curious why the relationship is being established like this. Perhaps I am missing the obvious, but it seems much more complicated.

Thanks!
SGM

Comments

  • If you are trying to get the item tracking lines to print for each invoice line on the invoice.. I can help... send me your email address and I will forward you the instructions to do so...
  • bbrownbbrown Member Posts: 3,268
    Look at the table "Item Entry Relation" to establish the relationships between "Item Ledger Entry" and posted documents.
    There are no bugs - only undocumented features.
  • jreynoldsjreynolds Member Posts: 175
    The "Item Entry Relation" table establishes a relationship between item ledger entries and posted document lines (typically sales shipments and purchase receipts). And the "Value Entry Relation" table establishes a relationship between value entries and posted document lines (typically posted sales and purchase invoices). Since you are starting from the posted sales invoice you will have to use the value entry relation table to find the related value entries and from there find the item ledger entries which will contain the serial numbers.
Sign In or Register to comment.