Skip to main content

Notifications

Announcements

No record found.

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.
 
  • Community member Profile Picture
    Community member 24 on at
    Cancel bulk transfer order
    initializing the form to mark around 6000 records which will be used to cancel the transfer order,since it get initialized from Form.
  • Suggested answer
    Waed Ayyad Profile Picture
    Waed Ayyad 6,556 Super User 2024 Season 2 on at
    Cancel bulk transfer order
    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.

  • Waed Ayyad Profile Picture
    Waed Ayyad 6,556 Super User 2024 Season 2 on at
    Cancel bulk transfer order
    .
  • Community member Profile Picture
    Community member 24 on at
    Cancel bulk transfer order
    Need to write this in a job to cancel around 6000 transfer order shipped by a specific user.
  • Waed Ayyad Profile Picture
    Waed Ayyad 6,556 Super User 2024 Season 2 on at
    Cancel bulk transfer order
    Hi,
     
    Where you added this code? also do you want to cancel orders? Can you give us more details?
     
     
    Thanks,
    Waed Ayyad

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,735 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans