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
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.
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,134 Super User 2024 Season 2
Martin Dráb 229,928 Most Valuable Professional
nmaenpaa 101,156