web
You’re offline. This is a read only version of the page.
close
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 amend batch job group?

(0) ShareShare
ReportReport
Posted on by 470

Hi,

I have a batch job created by code using sysOperationFramework with executionMode:relaible async (no dialog appears class gets called when a button is clicked directly)

For reliable async, when it runs, a record gets created in batch job table, then it disappears and only appears in batch job history table.

So since alot of batch job records gets created each time it runs. How can i change batch group for it?

Can i do it from the UI? Or only by code? And how?

I have the same question (0)
  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at

    Hi, Please check this thread for adding batch group by code. Although not verified answer but see if it helps.

    community.dynamics.com/.../424132

  • DELDYN Profile Picture
    470 on at

    Hi Mohit,

    So for reliable async, i can only change it by code? I can't do it from the UI?

  • DELDYN Profile Picture
    470 on at

    Hi Mohit,

    I tried ParmReliableAsyncBatchGroupId("Workflow")

    But it's still saved in "batch job table" as empty batch group

    What shall i do?

  • DELDYN Profile Picture
    470 on at

    I've noticed the following:

    if i try ScheduledBatch as execution mode and put this line in controller   (assume DBatchGroup value is Generic)

    controller.batchInfo().parmGroupId(DParameters::find().DBatchGroup);

    like code below... then when I checked batch table, the batchGroupId was changed correctly to Generic. However, when I checked BatchJob table, the batch group was empty

    So what's wrong here?
        protected void new()
        {
            super(classStr(DService),methodstr(DService,perpareD),SysOperationExecutionMode::ScheduledBatch);
        }
    
        public static Controller construct(Id _Id = '')
        {
            Controller controller = new Controller();
            controller.parmShowDialog(false);
            controller.parmShowProgressForm(false);
            Contract  contract =  controller.getDataContractObject();
            contract.Id(_Id);
            controller.batchInfo().parmGroupId(DParameters::find().DBatchGroup);
            return controller;
        }



    And for reliable Asnc (Which is what I'm interested in) if I use this code
     
    controller.parmReliableAsyncBatchGroupId(DParameters::find().DBatchGroup);

    How can I know if it's working correctly, since batch job history doesn't have batch group and records for reliable async don't exist in batch table or batch job table????


        protected void new()
        {
            super(classStr(DService),methodstr(DService,perpareD),SysOperationExecutionMode::ReliableAsync);
        }
    
        public static Controller construct(Id _Id = '')
        {
            Controller controller = new Controller();
            controller.parmShowDialog(false);
            controller.parmShowProgressForm(false);
            Contract  contract =  controller.getDataContractObject();
            contract.Id(_Id);
            controller.parmReliableAsyncBatchGroupId(DParameters::find().DBatchGroup);
            return controller;
        }




    Can someone please help me in setting batch group? and if it's doable for reliable async??


    goshoom Andre Arnaud de Calavon can you please help??

  • DELDYN Profile Picture
    470 on at

    An update to my last reply above.

    I was able to fix the issue for scheduled batch by adding an extra line for batch header (in order for the batch group value to appear at both tables[batch,batchJob. So at the end, it looked like this

    controller.batchInfo().parmGroupId(DParameters::find().DBatchGroup);
    controller.batchInfo().parmBatchHeader().parmBatchGroup(DParameters::find().DBatchGroup);


    Now again for reliable Async I made it like this (not sure if all three lines are needed --can someone please confirm?) and if yes, why I do I need to edit the three parameters??
    controller.parmReliableAsyncBatchGroupId(DParameters::find().DBatchGroup);
    controller.batchInfo().parmGroupId(DParameters::find().DBatchGroup);
    controller.batchInfo().parmBatchHeader().parmBatchGroup(DParameters::find().DBatchGroup);


    can someone confirm to me that reliable Asycn batch group can be edited?? as I said before, How can I know if it's working correctly, since for reliable async, records in batch job history don't exist in batch table or batch job table????

    goshoom 

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 700 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 567 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 408 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans