Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

How to amend batch job group?

(0) ShareShare
ReportReport
Posted on by 308

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?

  • DELDYN Profile Picture
    DELDYN 308 on at
    RE: How to amend batch job group?

    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 

  • DELDYN Profile Picture
    DELDYN 308 on at
    RE: How to amend batch job group?

    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
    DELDYN 308 on at
    RE: How to amend batch job group?

    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
    DELDYN 308 on at
    RE: How to amend batch job group?

    Hi Mohit,

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

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: How to amend batch job group?

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

    community.dynamics.com/.../424132

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,934 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans