web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Multi thread batch job not executing in the selected batch group

(0) ShareShare
ReportReport
Posted on by 5

Hi,

I have a multi thread batch that it doesn't matter what batch group I select to be executed in, the thread tasks are always created on the empty batch group. If affects how is processed because the batch group I want my process to run has some batch servers assigned for its processing and the empty batch group has a different set of servers for processing.

This means that any batch process I have that is multi thread will run its child tasks on the wrong servers rather than the ones defined in the batch group I selected when executing the process.

Class: CustAgingSnapshot

// Code to create the batch header

if (!hasJobBeenSplit && isRunInBatch)
    {
        batchHeader = BatchHeader::getCurrentBatchHeader();

        if (batchHeader == null)
        {
            batchHeader::construct(this.parmCurrentBatch().RecId);
        }

// Code to create the extra tasks
private void createSubJobs(BatchHeader _batchHeader)
{
    CustAgingSnapshot custAgingSnapshot;

    custAgingSnapshot = CustAgingSnapshot::construct();

    custAgingSnapshot.unpack(this.pack());
    custAgingSnapshot.parmHasJobBeenSplit(true);

    batchInfo = custAgingSnapshot .batchInfo();
    batchInfo.parmCaption(strFmt('%1 : %2', fromCustomer, toCustomer));
    _batchHeader.addRuntimeTask(custAgingSnapshot, this.parmCurrentBatch().RecId);
}


End result: 

Task-processing.PNG

The very first task that is created when the batch is created and it's assigned with the right batch group I selected when executing my process, the following tasks created with an empty batch group, hence they are executed in another servers.

How can I make sure child tasks are created with the same batch group?

Thanks,

*This post is locked for comments

I have the same question (0)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 26

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans