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

runnable class

(0) ShareShare
ReportReport
Posted on by 496
Hi,

If i create a runnable class without a menu item, that prints few things

it can be run multiple times in PROD/UAT, right? 

but i can't run it as batch unless i move the code from runnable class to sysOperationFramework correct? and in this case i will need a menu item?
Categories:
I have the same question (0)
  • Suggested answer
    Anthony Blake Profile Picture
    3,037 Super User 2026 Season 1 on at
     
    "it can be run multiple times in PROD/UAT, right?" - correct, you can run it via the class runner URL, use the format <D365URL>/?cmp=<CompanyName>&mi=SysClassRunner&cls=<RunnableClassName>

    "but i can't run it as batch unless i move the code from runnable class to sysOperationFramework correct? and in this case i will need a menu item?" - yes that's the best way, there is RunBaseBatch but SysOperationFramework is better and preferred. Then create an Action Menu to run your class.
     
    Thanks
    Anthony
  • Martin Dráb Profile Picture
    238,560 Most Valuable Professional on at
    You don't necessarily need a menu item if you use SysOperationFramework. If you implement a custom controller, as usual, it's a runnable class, so you can execute it in the same way as your current class.
     
    On the other hand, if you use a menu item, you don't have to implement your own controller. There you can specify which method of which class will be called by the default controller.
     
    Actually, any class you want to call by a menu item must be runnable. Therefore saying that you must use a menu item instead of a runnable class doesn't make a good sense.
  • Sagar121 Profile Picture
    1,088 Super User 2026 Season 1 on at
    Hi, Menu item is not mandatory even if you use SysOperation . If a class has a main method, you can run it directly without creating a menu item (just use normal runnable class URL). Menu items are typically used when you want to show them in modules and want to have security implementation.  Ideally you should create for sure, but if you are doing one time activity(data update) then probably you can skip creating menu item as you will probably delete these code once you are done. 

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... 673 Super User 2026 Season 1

#1
André Arnaud de Calavon Profile Picture

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

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 391 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans