web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Flow DateCode Field To Lot No. Information List

(5) ShareShare
ReportReport
Posted on by 23
Hello,  
I hope this message finds you well.  
I am currently working on a request to add a DateCode field to the purchase line in our business system. The DateCode represents the manufacturing date of a lot, formatted as WWYY. My goal is to ensure that the values from the DateCode field on the purchase line flow through to the Lot No. Information Card, which is automatically created upon PO Posting. This feature is enabled through the Item Tracking Codes under the Lot section, specifically the "Create Lot No. Info on Posting" option.  
From my research, I understand that the Lot No Creation Method exists in Codeunit 6500, and I need to subscribe to it. However, for this subscription to work, the "Item Tracking Specification" record must include the DateCode field. Since the Item Tracking Specification is created through the Reservation Entry table, I realize that I need to add the DateCode to that table as well.  
Unfortunately, this approach does not seem to be working. I have spent over a week on this task without making significant progress. I have added the DateCode field to several tables, including the Tracking Specification, Reservation Entry, Lot No Information, Item Ledger Entry, Item Journal Line, and the Purchase Order Subform. Below, you will find a portion of the code I have written for the event subscription.  
I would greatly appreciate any assistance or clarification if I have misunderstood anything.  
Thank you for your help!
 
I hope you are doing well while reading this question.
 
In our business, I have got a request to add a DateCode field to the purchase line, DateCode is a code that symbols when was this lot manufactured in the format WWYY, however, I need to flow this DateCode field values from the purchase line, to the Lot No. Information Card, which is automatically created on PO Posting (This option was enabled from Item Tracking Codes -> Lot -> Create Lot No. Info on Posting. As per my research, I have understood the following: The Lot No Creation Method exist in Codeunit 6500, which you need to subscribe to. However, to subscribe, the record "Item Tracking Specification" Must have the DateCode Field in it, while the Item Tracking Specification gets created through Reservation Entry Table, this means that I need to add the Datecode to the Reservation Entry table. However, this approach does not seem to work, I have been working on this task for over a week, and still not reaching to any point, I have added the date code field to the following tables: Tracking Specification, Reservation Entry, Lot No Information, Item Ledger Entry, Item Journal Line, Purchase Order Subform below you can find a portion of the code that I have created for events subscription.
 
I appreciate any help in this, or any clarification if there's something that I misunderstood.
 
I have the same question (0)
  • Suggested answer
    Suresh Kulla Profile Picture
    49,097 Super User 2025 Season 2 on at
    Flow DateCode Field To Lot No. Information List
    You can subscribe to the OnAfterPostItemJnlLine event from the 90 codeunit, and then locate the Lot No. An information card will be created by that time, and then the value from the Purchase Line will be assigned and modified.
     
     
  • Suggested answer
    YUN ZHU Profile Picture
    89,830 Super User 2025 Season 2 on at
    Flow DateCode Field To Lot No. Information List
  • Suggested answer
    Ramesh Kumar Profile Picture
    7,493 Super User 2025 Season 2 on at
    Flow DateCode Field To Lot No. Information List
    You need to add Datecode to below following table
     
    • Purchase Line

    • Reservation Entry

    • Tracking Specification

    • Item Ledger Entry (optional for traceability)

    • Lot No. Information (final destination)

    Carry DateCode into Item Tracking Lines

    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", 'OnAfterTransferPurchLineFields', '', false, false)]
    local procedure OnAfterTransferPurchLineFields(var PurchLine: Record "Purchase Line"; var TrackingSpecification: Record "Tracking Specification")
    begin
        TrackingSpecification."DateCode" := PurchLine."DateCode";
    end;

     

    Thanks, Ramesh

     

    If this was helpful, please check the "Does this answer your question?" box and mark it as verified.

  • Suggested answer
    Sohail Ahmed Profile Picture
    10,958 Super User 2025 Season 2 on at
    Flow DateCode Field To Lot No. Information List
    As of my understanding/knowledge, to pass a custom DateCode from the purchase line into the Lot No. Information Card, you need to extend the flow of fields used in Item Tracking Specification. Adding the field to tables alone won’t work — you must also use an event subscriber in Codeunit 6500 (Item Tracking Management) to transfer the DateCode when creating Lot No. Information. The clean approach is:
     
    1. Add DateCode to Item Tracking Specification and Lot No. Information.
     
     
    2. Subscribe to events in CU6500 where Lot Info is created and move the DateCode across.
     
     
    3. Test by posting a PO with lot tracking enabled.
     
     
     
    Maybe other experts can have better solutions for your query.
     
     
     
    ✅ Mark this as the verified answer if helpful.
     
     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,899 Super User 2025 Season 2

#2
Sumit Singh Profile Picture

Sumit Singh 2,444

#3
Jeffrey Bulanadi Profile Picture

Jeffrey Bulanadi 2,304

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans