Good morning,
i developed several jobs using the SysOperationFrameWork. This jobs can be started by simply clicking the menu item or by X++ during certain processes.
Now i wonder if i can use the "old" MenuFunction method to call this job by code because the calling procedure for SysOperation-jobs differs from RunBaseBatch. My job takes a WaveId as a parameter.
How would you call a SysOperation by X++?
Regards
Nils
*This post is locked for comments
I'm sorry, but I can't comment on the error without any information about it. Please share the error message with us and look at which piece of code is throwing it.
Hi Martin, I also have a small question similar to Nils. I used MenuFunction to call a Lasernet class through following line of code.
new MenuFunction(menuItemActionStr(LACResendReportPreview), MenuItemType::Action).run(args);
This works well when i run it as a job but when i do the same thing in Batch job and schedule it. this line of code throw error.
Is there any other way to call a actionMenuItem in a batch job.
@Amrita Bhattacharjee
sorry i missed you post.
Yes this should work for me now
you are right
[DataContractAttribute] was missing in the class declaration. It was the only Contract class where this metadata was missing. Strange that i didn't get this error earlier
I will try that
"No metadata class defined for data contract object" means that your data contract is invalid. The most common reason is forgetting to decorate the contract class with the DataContractAttribute.
Try this
SalesTable salesTable= SalesTable::find('QFCA-000002');
Args args = new Args();
args.record(salesTable);
args.caller();
new MenuFunction(menuitemDisplayStr('SalesLine'), MenuItemType::Display).run(args);
Here is an example of what happens if i try to run the job via MenuFunction. I think i have to pass a DataContract somehow but don't know where.
static void Job26(Args _args) { Args args = new args(); args.record(WHSWaveTable::find("CHWAWV0000000093")); new MenuFunction(menuitemActionStr(KVCleanupSorterService), MenuItemType::Action).run(args); }
Error:
Edit:
In my case i just needed the funtionality of a method, not the other things provided by the SysOperationFramework. I wasn't clear about this.
That doesn't really explain your code that caused "an error in the controller class because it had no DataContract".
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,134 Super User 2024 Season 2
Martin Dráb 229,928 Most Valuable Professional
nmaenpaa 101,156