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 :
Microsoft Dynamics AX (Archived)

How to reverse these hundreds of posted inventory movement journals by X++ code

(0) ShareShare
ReportReport
Posted on by 2,676

I have posted some hundreds of inventory movement journals and suddenly we realized that most of them are wrong, how to reverse these hundreds of posted inventory movement journals by X++ code, any idea/job?

Regards,

-Afsar

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Brandon Wiese Profile Picture
    17,788 on at

    On the journal form there is a button called Functions -> Copy that creates and populates a new journal from an existing one.  The code behind this is Classes\InventJournalCopy.  In the run() method you could temporarily modify the copyInventJournalTrans(..) internal function to reverse the sign of inventJournalTransTo.qty before the record is inserted.  Or, if this is something you expect to do regularly, you could add a parameter to the dialog like "Reverse quantity" and code accordingly.

  • Brandon Wiese Profile Picture
    17,788 on at

    If you wanted to automate the reversing process in code, you could use InventJournalCopy something like this (look at InventJournalCopy::main(..) for usage hints) --

    InventJournalCopy   copy = InventJournalCopy::construct();

    copy.getLast();

    copy.parmJournalIdFrom( journalNumHere );

    copy.run();

    This is not tested code.  Use at your own risk.

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Sagar Suman Profile Picture

Sagar Suman 2 Super User 2026 Season 1

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans