Notifications
Announcements
No record found.
Hi All,
Is there anyone have idea about how to create and post Inventory Adjustment Journal via x++??
Thanks&Regards
Veeramani S
*This post is locked for comments
static void SampleInvAdjJour_SC(Args _args) { InventJournalTable inventJournalTable; InventJournalTrans inventJournalTrans; InventJournalNameId inventJournalName; InventDim inventDim; JournalCheckPost journalCheckPost; //<Creation of journal header> inventJournalTable.clear(); inventJournalName = InventJournalName::standardJournalName(InventJournalType::LossProfit);//Type LOSSPROFIT is Adjustment inventJournalTable.initFromInventJournalName(InventJournalName::find(inventJournalName)); inventJournalTable.insert(); //<end Creation of journal header> //<Creation of journal Line> inventJournalTrans.clear(); inventJournalTrans.initFromInventJournalTable(inventJournalTable); inventJournalTrans.TransDate = systemDateGet(); inventJournalTrans.ItemId = "D0001"; //change here item number inventJournalTrans.initFromInventTable(InventTable::find("D0001"));//also change here item number inventJournalTrans.Qty = 10;//qunatity inventDim.InventSiteId = '1'; inventDim.InventLocationId = '11'; //you can add here as many inventory dimensions as required inventJournalTrans.InventDimId = inventDim::findOrCreate(inventDim).inventDimId; inventJournalTrans.insert(); //</End Creation of journal Line> //<Post Journal> journalCheckPost = InventJournalCheckPost::newPostJournal(inventJournalTable); journalCheckPost.run(); //<End post Journal> info('Ok'); }
Thanks sohaib
Thank you for your code.
I have a problem with that though.
it says "Voucher number must be filled in"
Would you mind telling me what is it for and how can I fill it? in our system it seems to be a sequence of numbers. Is there any way to get the next number of the sequence?
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2