🧠 Overview
In Dynamics 365 Finance and Operations (D365FO), a Runnable class (also known as a job) is an X++ class with a main
method that can be executed independently. While developers often run these classes from Visual Studio or via a menu item, you can also trigger them directly via a browser URL — which is especially useful in testing, automation, or debugging environments.
This post explains how to run a Runnable class using a URL, the parameters involved, and best practices to follow.
🚀 Methods to Run a Runnable Class
There are three main ways to execute a Runnable class in D365FO:
-
Using a Menu Item
-
Create a menu item referencing the class.
-
Add it to a form or workspace and launch it from the UI.
-
-
Using Visual Studio
-
Set the class as the Startup Object and run it with debug support.
-
-
Using a Web Browser URL ✅
-
Run the class directly by composing a special URL.
-
🔗 Format of the URL
✅ Parameter Breakdown
Parameter | Description |
---|---|
your-d365fo-environment | The full base URL of your D365FO environment (e.g., https://usnconeboxax1aos.cloud.onebox.dynamics.com ) |
cmp | The legal entity (company code) where you want to execute the class (e.g., USMF ) |
mi | Set to SysClassRunner (required to launch X++ classes from the URL) |
cls | The name of your Runnable class (e.g., SalesOrderCounter ) |
🌐 Full Example URL
When you paste this into your browser (and you're logged into the environment), the class will execute immediately — assuming it has no UI and handles all logic in the main()
method.
🛡️ Best Practices
-
Ensure the class extends
RunBase
or uses a validmain()
method structure. -
Keep the class side-effect safe (no unintended updates unless needed).
-
Always test in a sandbox before trying this in a production instance.
-
Consider adding a confirmation prompt or logging if the class performs any critical updates.
📌 Bonus Tip: Create a Static Bookmark
For classes you run frequently (e.g., cache clearing, data sync), you can bookmark the execution URL for quick access.
✅ Example Runnable Class (Minimal)
📚 Conclusion
Using the browser-based URL execution method is a quick and efficient way to run Runnable classes in D365FO. It eliminates the need to compile/run from Visual Studio or navigate through menu items. Just build the URL, log in, and run your code instantly.
0 Comments