Notifications
Announcements
No record found.
Hi there, i had created a class which has logic to populate the Sales Order status in my newly created table. The class has to run as a batch job and for that i created Action menu item and added object as myClassName. I had added the action menu item in the required menu and tried to run the batch from front end. But from here am getting error like 'object reference not set to instance ' error. I tried to debug from Visual Studio and the batch was working fine but when am tring to call from front end it was throwing the error. Please find the action menu item properties from the screenshot attached and please let me know the corrections so that i can run batch job from Action menu item after adding it to front end (Menu). Thanks in advance.
Here Class Name is : HamMagentoOnlineOrderStatusService. This class has main method added within it.
Hi premK6969,
How do you run your action menu items from UI? Have you added it to the main menu? Do you see the dialog or it's just failing when you try to open it? Is it runbase or sysOperation operation?
Hi Sergei, i had added my class to Action menu item and added it to Main Menu as per business requirement. Do we need to extend our class to runbase or am not sure since am new to batch jobs. While openings the added action menu item it was throwing message like object reference not set to instance. But the same i can able to run from Visual Studio.
Could you, please, share your main method?
By the way, you can use the "Attach to process" option for debugging start for the main menu case.
microsoftdynamix.blogspot.com/.../d365fo-debugging.html (the process you are interested could be w3wp.exe or iisexpress.exe)
Hi,
Your menu item settings look correct. So, your classes main method is called. Could you please share your code? That helps us notice what's the problem with it. Thanks!
By the way, if you want your class to be runnable as a batch job, you need to use SysOperation or RunBase framework.
Hi Nikolaos, i have a code in my class with main method. Can u let me the process how to make it as runnable class. Please let me know the steps to make it as runnable class and add the menu item in Under System Administration>Periodic setup. Thanks
"Runnable class" is a class that has a main method. So if you have a main method, it's already a runnable class.
You can add your menu item in System administration - Periodic by creating a Menu extension and adding your menu item to the extension.
Hi premK6969
I think you are not clear with your requirement.
1. There are two types of templates present in D365 as shown in below :
So either you created a class OR you created a runnable class ( A job basically).
2. A runnable class(job) object already has main method by default. and in a class you need to create an entry point.
3. In class you can extend it from runbase or sysoperation framework but that is not in case of runnable class.
As per my understanding if you want to run your logic it is better you can create a class and extend it with runbase or sysoperation as per your requirement.
could you give us an update on the status of this issue? Are you still having some problems?
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 451 Most Valuable Professional
André Arnaud de Cal... 428 Super User 2025 Season 2
BillurSamdancioglu 239 Most Valuable Professional