Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2020 release wave 1 Discover the latest updates and new features to Dynamics 365 planned through September 2020
Release overview guides and videos Release Plan | Preview 2020 Release Wave 1 Timeline
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
I have to add the serial number to our "purchase - receipt" report.
If an article has a serial number, the serial number should be displayed.
In the "sales - shipment" report the serial number or lot number are displayed in a separate table below the article table by default (we use NAV 2018).
There I have added the following code to concatenate all serial number of an article to display them below the article.
Sales Shipment Line - OnAfterGetRecord()
SerialNoText := '';
IF ("Sales Shipment Line".Type = "Sales Shipment Line".Type::Item) THEN BEGIN
TrackingSpecCount := ItemTrackingDocMgt.RetrieveDocumentItemTracking(SL_Tracking, "Sales Shipment Header"."No.", DATABASE::"Sales Shipment Header", 0);
SL_Tracking.SETRANGE("Item No.","Sales Shipment Line"."No");
IF SL_Tracking.FINDFIRST THEN REPEAT
IF SL_Tracking."Serial No." <> '' THEN SerialNoText := SerialNoText + SL_Tracking."Serial No." + ', ';
UNTIL SL_Tracking.NEXT = 0;
IF SerialNoText <> '' THEN BEGIN
SerialNoText := 'SN: ' + SerialNoText;
SerialNoText := DELCHR(SerialNoText '>', ', ');
SerialNoText - DataType: Text
ItemTrackingDocMgt - DataType: Codeunit - Subtype: Item Tracking Doc. Management
SL_Tracking - DataType: Record - Subtype: Tracking Specification
TrackingSpecCount - DataType: Integer
I thought I could use the same code for the purchase - receipt report (I replaced "Sales Shipment Header" with "Purch. Rcpt. Header" and "Sales Shipment Line" with "Purch. Rcpt. Line"), but when I run the report, I get the following error returned: "Table 120 is not supported".
Since Table 120 is the Purch. Rcpt. Header, I think the error is at the "TrackingSpecCount := ..." line.
How can I fix this proplem?
Is there maybe a better way of displaying the serial number for the purchase - receipt report?
Instead of RetrieveDocumentItemTracking try with RetrieveEntriesFromShptRcpt of the same codeunit.This functions needs other parameters but based on the documentation it seems to deliver what you are looking for.
There is no RetrieveEntriesFromShptRcpt function.
When I type the object name, I get the following functions suggested: CollectItemTrkgPerPostedDocLine, CopyItemLedgerEntriesToTemp, RetrieveDocumentItemTracking, SetRetrieveAsmItemTracking, ShowItemTrackingForInvoiceLine, ShowItemTrackingForMasterData, ShowItemTrackingForProdOrderComp, ShowItemTrackingForShptRcptLine and RUN.
Is ShowItemTrackingForShptRcptLine similar to RetrieveEntriesFromShptRcpt?
Ah, I can see it now - it's a local function.
Try with FindShptRcptEntries which calls RetrieveEntriesFromShptRcpt.
There is no FindShptRcptEntries function that I can call (it's not visible as suggestion when I try to call the function for the code unit "Item Tracking Doc. Management").
Does the function exist in another code unit?
Is it possibly to display the lot no. and serial no. with a different code unit?
You can get it from item ledger entry, add below code inside "Purch. Rcpt. Line" -OnafterGetRecord inside your report :
SerialNoText := '';
ItemLedgerEntry.SETCURRENTKEY("Document No.","Document Type","Document Line No.");
ItemLedgerEntry.SETRANGE("Document No.","Purch. Rcpt. Line"."Document No.");
ItemLedgerEntry.SETRANGE("Document Type",ItemLedgerEntry."Document Type"::"Purchase Receipt");
ItemLedgerEntry.SETRANGE("Document Line No.","Purch. Rcpt. Line"."Line No.");
IF ItemLedgerEntry.FINDFIRST THEN
SerialNoText := ItemLedgerEntry."Serial No.";
Thank you very much.
This works really well :)
Business Applications communities