Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

How to run batch job Using sysoperation framework?

(0) ShareShare
ReportReport
Posted on by 920

Hi, 

I create this dialog using SysOperation : 

pastedimage1599646598293v1.png

I want to choose in the second tabPag the recurrence of batch , But in which method of class I put my code : 

Now to put all code in the method main () , so  :  despite I chose the batch, the code is executed directly without going through the batch

  • Suggested answer
    nmaenpaa Profile Picture
    101,156 Moderator on at
    RE: How to run batch job Using sysoperation framework?

    This blog shows how to pass values from caller -> controller -> data  contract -> service class:

    community.dynamics.com/.../ax2012-sysoperation-part-2-sysoperationservicecontroller

  • BASMA Profile Picture
    920 on at
    RE: How to run batch job Using sysoperation framework?

    Thanks Nikolaos Mäenpää  I understand the logic ,

    just one thing I need args from the main method , to use it in the batch => I means that I need It in the class service : 

    this is the method in service class , now just I display values 

    [SysEntryPointAttribute]
    public void CreateRole(EUKGnerateRoleContract _eukGnerateRoleContract)
    {
        // info the name parameter
        info(_eukGnerateRoleContract.parmDescription());
        info(_eukGnerateRoleContract.parmMatrixName());
        info(_eukGnerateRoleContract.parmMatrixNum());
        info(_eukGnerateRoleContract.parmRoleName());
        }

    pastedimage1599734409136v1.png

    I want to use args from controller in service class

  • Suggested answer
    nmaenpaa Profile Picture
    101,156 Moderator on at
    RE: How to run batch job Using sysoperation framework?

    Yes there is, in TutorialSysOperationService\runService. There it prints infolog "Done" when the batch is executed.

    And in TutorialSysOperationController\new we have code that points in the service class and runService method.

  • BASMA Profile Picture
    920 on at
    RE: How to run batch job Using sysoperation framework?

    in the example, there isn't any business logic to execute in batch

  • Suggested answer
    nmaenpaa Profile Picture
    101,156 Moderator on at
    RE: How to run batch job Using sysoperation framework?

    new() method is not calling any business logic. There you merely tell which service class and method should be triggered when the batch runs.

    You can see all this in the simple example in the blog that I shared.

  • BASMA Profile Picture
    920 on at
    RE: How to run batch job Using sysoperation framework?

    But the new method, is called before the startOperation method, so the code will execute directly.

    I am sorry for all these questions 

  • Suggested answer
    nmaenpaa Profile Picture
    101,156 Moderator on at
    RE: How to run batch job Using sysoperation framework?

    In the example blog, it's in the runService method of the service class.

    The method name can be anything, but in the new() method of your controller class you must tell the system which class/method to use when running the batch.

  • BASMA Profile Picture
    920 on at
    RE: How to run batch job Using sysoperation framework?

    the problem is , where I can put the code of business logic  : that will be executed in batch.

    controller .startoperation() : opens  a setup dialog

  • Suggested answer
    nmaenpaa Profile Picture
    101,156 Moderator on at
    RE: How to run batch job Using sysoperation framework?

    I don't understand the question.

    When you run the code (main method of the controller class) it opens a setup dialog. There you can specify that you want to run it in batch. After you click OK, the job is saved in batch jobs. And then the batch processing will execute it.

  • BASMA Profile Picture
    920 on at
    RE: How to run batch job Using sysoperation framework?

    I have the same instruction of code,

    now I want to execute the code in batch , where I can put it to run  in batch

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,884 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,748 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans