Notifications
Announcements
No record found.
Hi experts,
How can I cancel the transfer order throw x++? I try this class InventTransferMultiShipCancel but I can't use it well.
In main method of class InventTransferMultiShipCancel you have the way to cancel. You just need to pass the record to cancel in args parameter.
Just the replicate main code to your needs. You can also execute main method if you need the confirmation message
InventTransferMultiShipCancel InventTransferMultiShipCancel = InventTransferMultiShipCancel::construct(); ttsbegin; RunBaseMultiParm::initFromForm(InventTransferMultiShipCancel, _args); InventTransferMultiShipCancel.runOperation(); ttscommit; InventTransferMultiShipCancel.runReports(); InventTransferMultiShipCancel.refreshTransferOrderForm(_args);
Hi Nuno Maia
I did that before but not work for me
class CancelTransferOrder_Job { public static void main(Args _args) { InventTransferJour inventTransferJour = InventTransferJour::find("TO-001","TOV-001"); _args.record(inventTransferJour); InventTransferMultiShipCancel InventTransferMultiShipCancel = InventTransferMultiShipCancel::construct(); ttsbegin; RunBaseMultiParm::initFromForm(InventTransferMultiShipCancel, _args); InventTransferMultiShipCancel.runOperation(); ttscommit; InventTransferMultiShipCancel.runReports(); //InventTransferMultiShipCancel.refreshTransferOrderForm(_args); } }
Can I get more support please
When you debug, what are you getting ?
Hi Komi Siabi
I didn't get any errors the job is completed and the Transfer order did not cancelled
any help please
Hi Source,
I don't think this can help your issue. But you can make use of it.
Instead of x++ code, Microsoft has given feature for canceling transfer order. Please go through the below link.
https://exploredynamics365.home.blog/2020/11/07/transfer-order-cancellation-new-feature-in-microsoft-dynamics-365-finance-and-operations/
Thanks,
Girish S.
Hi GirishS
Thanks for your help. I know this feature and it's already enabled and we use it. but I need to cancel the transfer order throw x++.
I want to use it in API.
Can you make a simples simulation.
Add a breakpoint to InventTransferMultiShipCancel
1. Cancel Transfer Order from D365 Menu, can confirm parameters that are being executed.
2. Compare those parameters, to the ones you are passing to class
Please check the debug point from the system and from me
this args from the system. I click on cancel transfer order then add break point
this from the job i create it
Job Code
class XXXCancelTransferOrder_Job { public static void main(Args _args) { InventTransferJour inventTransferJour = InventTransferJour::find("TO-000057","TOV-054487"); FormRun formRun; _args.record(inventTransferJour); _args.menuItemName("InventTransferShipCancel"); _args.menuItemType(MenuItemType::Action); _args.parm(formStr(InventTransferJour)); _args.name(formStr(InventTransferJour)); formRun = classFactory.formRunClass(_args); _args.caller(formRun); XXXInventTransferMultiShipCancel::main(_args); } }
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.
Abhilash Warrier 669 Super User 2025 Season 2
André Arnaud de Cal... 471 Super User 2025 Season 2
Martin Dráb 423 Most Valuable Professional