Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

Start job by code

Posted on by 3,217

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

  • 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 224,741 Super User 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();

Helpful resources

Quick Links

Can you answer this forum question?

You could make someone's day!

Community Newsletter - May 2024

Kudos to our community stars!

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 283,663 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 224,741 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,146

Featured topics

Product updates

Dynamics 365 release plans