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

Notifications

Announcements

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

Responsible AI policies

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

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Volodya Profile Picture

Volodya 2

#2
tgudwanski Profile Picture

tgudwanski 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans