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
0
Comments