Monday, 9 November 2020

How to get ExecutionId at runtime in D365 FO Data management

 Get ExecutionId at runtime in Data entity.

Today, I am going to share a practice code to get ExecutionId at runtime in D365 FinOps.
Lets say, you are working on a data entity and you need to get ExecutionId at run time so that you can call you custom logic for that particular data job.

Check the data entity you are working on and find the 2- methods (1. postGetStagingData 2. postTargetProcess). If you don't find these methods, you can add in the Data entity extension.

Method-1:
// This is the method which executes before data execution from staging to target
public static void postGetStagingData(DMFDefinitionGroupExecution _dmfDefinitionGroupExecution)
{
        DMFExecutionId     executionId = _dmfDefinitionGroupExecution.ExecutionId;
}


Method-2:
// This is the method which executes after data execution in target at event of DMFEntityWritter.write()
public static void postTargetProcess(DMFDefinitionGroupExecution _dmfDefinitionGroupExecution)
{
        DMFExecutionId     executionId = _dmfDefinitionGroupExecution.ExecutionId;
}


Happy DAXing...

No comments:

Post a Comment