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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

DMF import multiple projects in one package checking end time in code

(3) ShareShare
ReportReport
Posted on by 1,195
Hello,
 
I would like to import the package of the multiple zip packages in DMF. I'd like to create a new batch job which will contain multiple batch tasks each of which will import one project after another in sequence. The next project will be imported only after the previous one is imported successfully.
 
If we tale a a look at the standard DMF import project batch which is created from this button
 
 
 
under the hood it runs DMFBatchImporter class which created a new batch job with one batch task like that
 
 
 
I'd like to create one batch job with multiple batch tasks each of which will import one separate DMF project and the new batch task should be created and started only after the previous one is ended successfully. In order to check that previous batch task is ended successfully I cannpt rely on the batch task end date time because it doesn't show the relevant time
 
 
the real time can be found in the project job history here
 
 
 
 
 
 
in order to check it I need from to time to check whether the job is finished and whether there is a field from above screenshot "end time" is filled up with value.
 
The question is there some best practice approach to do that in code? Maybe somewhere in the standard FO code it's done in some way. 
 
Thanks in prior.
Categories:
I have the same question (0)
  • Suggested answer
    Giorgio Bonacorsi Profile Picture
    2,230 on at
    Hello,

    You can use a data package that includes multiple data entities.
    This enables you to import several data entities in a defined sequential order, respecting dependencies between them: https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/lcs-solutions/process-data-packages-lcs-solutions

    Thank you,
    Giorgio
  • Suggested answer
    Rashid.Ali Profile Picture
    27 on at

    You can use batch task dependencies to run projects in sequence.

    Alternatively, a better approach is to create one DMF project with multiple entities, which avoids the need for chaining and simplifies execution.

  • dark_knight Profile Picture
    1,195 on at
    Hello   Rashid.Ali
     
    OK. How to use batchtask dependencies if I can't rely neither on end status nor on entd datetime of the batch task? They aren't relevant. So the only option is to rely on the project job history as I see it now. The question waht is the best practice approach for checking the state of the job in the code? How to achieve that? I can write the code, for example, that can every 30 seconds check the state of the job, but I'm not sure it's elegant solution. I cannot place all the entites from all the packages in one package for now because those packages come separately to the user.
     
    Maybe it's possible to somehow create a batch task that will end at the same time as the project job? In that case I'll be able to rely on the end date time of the batch task.
  • Suggested answer
    Saalim Ansari Profile Picture
    704 on at
    Hi,
     
    Don’t check EndDateTime in a loop.
    Instead, rely on DMF execution status + batch task dependencies that’s the standard and safest approach
     
    select top 10 DefinitionGroup, ExecutionId, ENDDATETIME, * from DMFDefinitionGroupExecution 
     
    Hope this helps
    Saalim
  • dark_knight Profile Picture
    1,195 on at
    I mean I don't want to do the polling of the exustion status in the execution job. But I don't see any other way for now. Or maybe there is some other approach I can use? I can't rely on the batch task endtime whcih I explained above.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 710

#2
André Arnaud de Calavon Profile Picture

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

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 317 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans