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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Update Missing Batch Numbers in Posted Inventory Transactions

(2) ShareShare
ReportReport
Posted on by 118
HI All, 

     In our live environment, the batch number is missing for two inventory transactions, even though the transfer orders were successfully created and financially posted.

Is it possible to update the inventory transaction records using a custom script, or is there any way—either through the frontend or backend—to update the batch numbers in the inventory transaction records? Additionally, the batch numbers should also be updated in the on-hand inventory.


 
Categories:
I have the same question (0)
  • Suggested answer
    H.M.Burhan Profile Picture
    390 Super User 2026 Season 1 on at

    You can reverse the entry and record it again with the batch number.

    Alternatively, you can use the Transfer journal to move the on-hand quantity from a blank batch number to a specific batch number.

    However, it is not recommended to update the data directly in the database.

    Cheers,
    Burhan
  • charanch Profile Picture
    118 on at
    Hi @H.M.Burhan thanks for your reply.

       why it is not recommended to update database directly, I mean what are the conflicts may happen.
  • Suggested answer
    H.M.Burhan Profile Picture
    390 Super User 2026 Season 1 on at

    Because it is difficult to identify all dependencies directly from the database, relying on direct data updates is risky. For example, while the batch number may be visible in inventory transactions, complications arise if the batch number is also configured to calculate and maintain item costs at Batch level. This is only one of many scenarios that are challenging to manage through direct database updates. Such actions can ultimately compromise the integrity and consistency of the system.

    Using the Transfer journal is an easy option. You can also use the Movement journal—simply reverse the entry and record it again with the correct batch number. This is an easier and more reliable way to update inventory transactions without any hassle.
     
    Cheers,
    Burhan

    If you found this answer helpful, please consider marking it as verified.
     
     
     
  • André Arnaud de Calavon Profile Picture
    303,730 Super User 2026 Season 1 on at
    Hi Charan,
     
    As mentioned by Burhan, try to reverse postings and perform the action again. How is it possible that the batch numbers were not registered? Are you allowing for empty batch numbers or is it caused by e.g. a customization?
     
    Anyway, don't make an attempt to update data in the tables directly. This will cause inconsistencies in the database. (Been there, done that. Learned from it).
  • Suggested answer
    SoumitraforD365 Profile Picture
    213 on at
    Hi Charanch,
    In D365 F&O once inventory transactions are financially posted, the batch number becomes part of the inventory transaction record and inventory value calculation.
    Since only two transaction are affected, the recommended approach is operational correction, not data manipulation.
    Option1: Reverse and Reprocess the transfer order. This would be the best practice by following the below steps:
    • Post a return transfer order or correct a correcting transfer back to original warehouse.
    • Ensue inventory returns to correct state
    • Recreate the transfer order with the correct batch number
    • Post again.
    This would be safest solution in production.
     
    Option 2: In case reversal not possible, you can try Inventory movement.
    • Move the inventory out of the incorrect (no batch) dimension using inventory movement journal.
    • Move it back using the correct batch number.
    My doubt is how it was possible to post transfer order without batch if the batch tracking is active on the item. (Subject to analysis).
    The possible reasons may be:
    • Tracking dimension group was changed
    • Batch was not active at posting time
    • Customization bypassed validation

    In order to conclude as other community members also suggested, try to use reversal or inventory adjustment instead of updating inventory transactions directly through script or via SQL. This will help to preserve Inventory valuation, Financial accuracy, batch traceability.

    I suggest to try with the given advise in test environment first, get all the inventory and financial transaction rechecked and than do the same in live environment.

    BR
    Soumitra

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 658

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 468 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 333 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans