Skip to main content
Post a question

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Inquiry: Automating LOT Number Assignment & Item Allocation Rules in MS BC

Like (1) ShareShare
ReportReport
Posted on 30 Jan 2025 13:24:23 by 6

I have a couple of queries regarding LOT number assignment and item allocation rules in Microsoft Business Central:

  1. Automating LOT Number Assignment:
    Currently, while receiving products via purchase receipt or production receipt, even if the LOT number series is predefined in the Item Master, users still need to manually navigate to "Item Tracking Lines" and click "Assign LOT No." for the system to generate the LOT number.

    Given that some POs have over 100 lines, this manual process creates significant additional work. Is there a way to automate this process so that the system automatically assigns the LOT without manual intervention? If not, is there an alternative approach to streamline this?

  2. Item Allocation Rules for LOT Assignment:
    Does MS BC allow setting item allocation rules for a specific item category or individual item? We have a requirement to automatically assign LOT numbers for production consumption or shipment based on allocation methods like FIFO, LIFO, FEFO, etc.

    If direct configuration is not possible, is there a workaround or customization option available to achieve this?

Looking forward to your insights on these requirements.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 44,895 on 03 Feb 2025 at 03:45:48
    Inquiry: Automating LOT Number Assignment & Item Allocation Rules in MS BC
    You can do it thru customization, you can do this when they enter the quantity or during the release of the PO but it has to be a customization. I have place the below code to create Lot No. for the Item on the purchase line you can call this 
     
     
    procedure CreateItemTracking(PurchaseLine: Record "Purchase Line")
        var
            Item: Record Item;
            ReservationEntry: Record "Reservation Entry";
            CreateReservEntry: Codeunit "Create Reserv. Entry";
            NoSeries: Codeunit "No. Series";
        begin
            if PurchaseLine.Type <> PurchaseLine.Type::Item then
                exit;
            if (PurchaseLine."No." = '') or (PurchaseLine.Quantity = 0) then
                exit;
            Item.Get(PurchaseLine."No.");
            Item.TestField("Lot Nos.");
            ReservationEntry."Lot No." := NoSeries.GetNextNo(Item."Lot Nos.");
            CreateReservEntry.CreateReservEntryFor(
                    Database::"Purchase Line", PurchaseLine."Document Type".AsInteger(),
                    PurchaseLine."Document No.", '', 0, PurchaseLine."Line No.", PurchaseLine."Qty. per Unit of Measure",
                    Abs(PurchaseLine.Quantity), Abs(PurchaseLine."Quantity (Base)"), ReservationEntry);
     
            CreateReservEntry.CreateEntry(
              PurchaseLine."No.",
              PurchaseLine."Variant Code",
              PurchaseLine."Location Code",
              '', PurchaseLine."Expected Receipt Date", 0D, 0,
              "Reservation Status"::Prospect);
            if GuiAllowed then
                Message(ItemTrackingCreatedLbl);
     
        end;
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 78,267 Super User 2025 Season 1 on 02 Feb 2025 at 23:45:14
    Inquiry: Automating LOT Number Assignment & Item Allocation Rules in MS BC
    Hi, This issue has been discussed for a long time, and as far as I know it can only be customized at present.
    Dynamics 365 Business Central: How to create Item Tracking Lines automatically during an inbound transaction (Customization)
     
    PS: Missing a feature? Post or vote for ideas on: aka.ms/BCIdeas
     
    Thanks.
    ZHU
  • gdrenteria Profile Picture
    gdrenteria 14,836 Most Valuable Professional on 02 Feb 2025 at 19:16:19
    Inquiry: Automating LOT Number Assignment & Item Allocation Rules in MS BC

    Hi, good day
    I hope this can help you, and give you some hints.

    Assign Lot Number automatically when PO is received

    Best Regards
    Gerardo

  • Suggested answer
    Khushbu Rajvi. Profile Picture
    Khushbu Rajvi. 9,255 Super User 2025 Season 1 on 01 Feb 2025 at 16:18:26
  • Suggested answer
    Dr Gomathi MVP, MCT Community lead, MLE Profile Picture
    Dr Gomathi MVP, MCT... 249 on 01 Feb 2025 at 16:14:21
    Inquiry: Automating LOT Number Assignment & Item Allocation Rules in MS BC

    Let me help you with both queries regarding LOT number handling in Business Central.

    1. Automating LOT Number Assignment:
      • Yes, there are several approaches to automate LOT number assignment:

    A. Using AL Code Extension:
    You can create an extension that subscribes to the Purchase Receipt/Production Receipt events and automatically creates item tracking lines.

    B. Power Automate Flow:
    You could create a flow that monitors new purchase/production receipts and automatically triggers the LOT assignment process.

     

    1. Item Allocation Rules for LOT Assignment:
      Business Central does provide some built-in functionality for item allocation, but it may not fully meet your specific requirements


    2.  

    A. Standard Functionality:

     

    • Use the "Item Tracking Code" setup to define basic rules

    • Configure "Strict FIFO/LIFO Expiration Posting" in Inventory Setup


    •  

    B. Custom Solution Approach:
    For more sophisticated rules, you could develop a custom solution

    Recommended Implementation Strategy:


       
     
    1. Short-term Solution:

      • Implement basic AL code extension for automatic LOT assignment

      • Use standard BC allocation methods where possible


      •  

    2. Long-term Solution:

      • Develop a comprehensive custom solution that:

        • Handles automatic LOT assignment based on item categories

        • Implements custom allocation rules

        • Provides flexibility for future rule modifications


        •  


      •  

    3. Change Management:

      • Train users on any new processes

      • Document the new allocation rules

      • Monitor system performance after implementation
    Hope this helps

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,595 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,551 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans