Announcements
No record found.
Hi Everyone,
I want to create planned order through X++ code.
And whichever Item I select, its Route and BOM details should be get added in Route details of Planned order.
Please suggest how can I achieve the same. Thank you in advance.
Hi Rhushikesh,
When you select item num,its Route and BOM details will Correspond change to display in dropdown list then you can select one in the list.
They are maybe a one-to-many relationship.
And what your real Requirements?
regards
Hi Judy,
Actually my client has said, there will be only on Active BOM and Route for this particular items for which planned orders need to be created through code.
So I just need to pick those Route and BOM details and have to create one planned order through code.
But how can I generate it through code is blocker for me.
To create a planned order based on the values filled in the dialog you can Call Method named createReqPO() of the class ReqTransPoCreate.
/// /// Creates a planned order based on the values filled in the dialog. /// /// /// true if the process did not throw an error; otherwise, false. /// public boolean createReqPO() { ReqPO saveReqPO; boolean createFailed; XDSServices xdsServices = new XDSServices(); #DirParty if (!reqPO.RecId) { // save current buffer saveReqPO.data(reqPO); // create planned order try { // Disable the DirPartyTable XDS policies by passing a non blank context string xdsServices.setXDSContext(0, #SystemUser); ReqPlannedOrder::construct().insertFromForm(reqPO,inventDim,fromInventLocationId,toInventLocationId,true,RecalculateBOMLevels.value()); // re-enable XDS policies xdsServices.setXDSContext(0, ''); } catch { createFailed = true; } if (!createFailed) { newReqPo.data(reqPO); if (newReqPo.RecId) { element.closeOk(); } else { // Due to firming time fence the planned order is already firmed and doesn't exists any longer // -> validateWrite can't be executed element.closeCancel(); } } else { // restore buffer reqPO.data(saveReqPO); } } return !createFailed; }
Hope it help you.
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.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Giorgio Bonacorsi 681
André Arnaud de Cal... 446 Super User 2026 Season 1
Syed Haris Shah 202 Super User 2026 Season 1