Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Start job by code

Posted on by 3,221

How can I start a Job by X++ Code?

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Start job by code

    Hi Martin,

    Thank You very much for your help to people.

    Its working great..

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 229,275 Most Valuable Professional on at
    Re: Start job by code

    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();

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,900 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,275 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans