Hi experts,
How can I cancel the transfer order throw x++? I try this class InventTransferMultiShipCancel but I can't use it well.
Hi experts,
How can I cancel the transfer order throw x++? I try this class InventTransferMultiShipCancel but I can't use it well.
Did it worked, Not worked for me
I create this method try it
public static void cancelTO(InventTransferId _transferId) { InventTransferJour inventTransferJour; InventTransferParmTable transferParmTable; InventTransferTable transferTable; select firstonly1 inventTransferJour where inventTransferJour.TransferId == _transferId && inventTransferJour.UpdateType == InventTransferUpdateType::Shipment; if(inventTransferJour) { transferParmTable.initParmDefault(); transferParmTable.ParmId = RunBaseMultiParm::getSysParmId(); transferParmTable.UpdateType = InventTransferUpdateType::Shipment; transferParmTable.TransferId = inventTransferJour.TransferId; transferParmTable.VoucherShipmentId = inventTransferJour.VoucherId; transferParmTable.CanceledShipmentJournalRecId = inventTransferJour.RecId; transferParmTable.write(); //cancelling the Transfer order InventTransferMultiShipCancel inventTransferMultiShipCancel; inventTransferMultiShipCancel = InventTransferMultiShipCancel::construct(); inventTransferMultiShipCancel.runUpdate(transferParmTable); } }
Hello,
did it work? i have the same problem.
Can i get help please
Hi Nuno Maia
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); } }
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
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.
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.
Thanks,
Girish S.
any help please
André Arnaud de Cal...
293,265
Super User 2025 Season 1
Martin Dráb
231,927
Most Valuable Professional
nmaenpaa
101,156
Moderator