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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Batch job multitask with dependency not working as expected

(0) ShareShare
ReportReport
Posted on by 2
Hello dear community,
 
I am working on a requirement to create a batch job for DMF import project to run with multiple tasks(it mean multiple import project in a single batch job) having dependency of being finishedorerror. I have created a script and it is scheduling the the batch job with number of defined tasks correctly, but issue is only the first task is executed and the other ones remain in a status /not run/. I am sharing the code and snap, any kind of help will be much appreciated. Thank you

X++ Code:
 
 BatchHeader batchHeader = BatchHeader::construct();
 DMFBatchImporter batchImporter = new DMFBatchImporter();
 DMFDefinitionGroup definitionGroup;
 select definitionGroup where definitionGroup.DefinitionGroupName == 'Customer Group2';
 batchImporter.batchInfo().parmBatchExecute(NoYes::Yes);
 batchImporter.parmReadyForBatchRun(true);
 DMFExecutionId batchExecutionId =
           DMFPackageImporter::PrepareDefinitionGroupForImport(definitionGroup.DefinitionGroupName);
 batchImporter.parmExecutionId(batchExecutionId);
 batchImporter.batchInfo().parmGroupId('Batch1');
 batchHeader.addTask(batchImporter);
 
 batchHeader.addRuntimeTask(batchImporter, BatchHeader::getCurrentBatchTask().RecId);
 batchHeader.parmBatchGroup('Batch1');
 RS_DMFProjectListBatchImporter integrationBatch = new RS_DMFProjectListBatchImporter();
 integrationBatch.batchInfo().parmBatchExecute(NoYes::Yes);
 integrationBatch.parmReadyForBatchRun(true);
 DMFExecutionId batchExecutionIdlocal =
           DMFPackageImporter::PrepareDefinitionGroupForImport('Customer payment method');
 integrationBatch.parmExecutionId(batchExecutionIdlocal);
 integrationBatch.batchInfo().parmGroupId('Batch1');
 //batchHeader.parmCaption(strFmt('%1 - Test Log - %2', TestIntegrationBatch::description(), logRecId));
// batchHeader.addTask(integrationBatch, BatchConstraintType::And);
 batchHeader.addRuntimeTask(integrationBatch, BatchHeader::getCurrentBatchTask().RecId, BatchConstraintType::And);
 batchHeader.addDependency(integrationBatch, batchImporter, BatchDependencyStatus::Finished);
 batchHeader.save();


You can see only the first import project from bottom executed and the other is in not run state

 
I have the same question (0)
  • Judy Profile Picture
    Microsoft Employee on at
    Moved to Finance Forum.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 396 Super User 2026 Season 1

#2
Subra Profile Picture

Subra 323

#3
Martin Dráb Profile Picture

Martin Dráb 243 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans