How can I start a Job by X++ Code?
*This post is locked for comments
Hi Martin,
Thank You very much for your help to people.
Its working great..
You can do that, but using a job instead of a class has only disadvantages (e.g. jobs aren't able to run on server side). Don't use jobs in any production code.
In general, you have two possibilities - to create a menu item and call it:
//you can change the type of called object without changing the invocation code
MenuFunction::runClient(menuItemActionStr(YourMenuItem), MenuItemType::Action);
or to run an application object via TreeNode:
#AOT
;
TreeNode::findNode(strFmt(#JobPath, identifierStr(YourJob))).AOTrun();
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... 290,900 Super User 2024 Season 2
Martin Dráb 229,275 Most Valuable Professional
nmaenpaa 101,156