web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Cancel bulk transfer order

(0) ShareShare
ReportReport
Posted on by 24
One of our customer have mistakenly shipped around 6000 transfer order. need to develop a script to cancel all the transfer order with the user and specific date.
Standard system allows to cancel 1 record at a time. When i added a duplicate menuitem with multiSelect = /Yes/, sytem allowed to cancel multiple transfer orders.
 
script : 
 
FormRun     formRun;
FormDataSource formDataSource = new FormDataSource();
formRun = ClassFactory.formRunClass(args);
formRun.init();
formDataSource = formRun.dataSource();
formDataSource.filter(fieldNum(InventTransferJour,CreatedBy),/SomeUser/);
formDataSource.init();
_args.menuItemName(/InventTransferShipCancel/);
_args.menuItemType(MenuItemType::Action);
_args.caller(formRun);
InventTransferMultiShipCancel InventTransferMultiShipCancel = InventTransferMultiShipCancel::construct();
ttsbegin;
RunBaseMultiParm::initFromForm(InventTransferMultiShipCancel, _args);
InventTransferMultiShipCancel.runOperation();
ttscommit;
 
Please suggest as this query is not selecting the records in formdatasource.
 
I have the same question (0)
  • Waed Ayyad Profile Picture
    9,061 Super User 2026 Season 1 on at
    Hi,
     
    Where you added this code? also do you want to cancel orders? Can you give us more details?
     
     
    Thanks,
    Waed Ayyad
  • Community member Profile Picture
    24 on at
    Need to write this in a job to cancel around 6000 transfer order shipped by a specific user.
  • Waed Ayyad Profile Picture
    9,061 Super User 2026 Season 1 on at
    .
  • Suggested answer
    Waed Ayyad Profile Picture
    9,061 Super User 2026 Season 1 on at
    Hi,

    Why you are trying to call the Form from the job, you can select the records that you want and call the code that is called when you click on the button. Try it and tell me if you want more help.


    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue.

  • Community member Profile Picture
    24 on at
    initializing the form to mark around 6000 records which will be used to cancel the transfer order,since it get initialized from Form.

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 663 Super User 2026 Season 1

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 289 Super User 2026 Season 1

#3
Martin Dráb Profile Picture

Martin Dráb 232 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans