DMF export operation using X++ in D365 for operation(AX 7)

Hi Everyone,

We will see how we can call a DMF export data project using X++.

In AX 7 we can add import/export as a batch job. here i am going to call a export operation as a batch job using X++.

I am going to create a export data project called ‘Customer groups’ to export customer group records into excel.

Once the data project created save it. then, create a new class to call this data project.

public static void main(Args _args)
DMFDefinitionGroup definitionGroup;
DMFDefinitionGroupName definitionGroupId;

select firstonly definitionGroup where definitionGroup.DefinitionGroupName ==’Customer groups’;
if (definitionGroup)
definitionGroupId = definitionGroup.DefinitionGroupName;

if (!definitionGroupId)
throw error(“@DMF:ExportDataProjectNotSpecifiedError”);

V_CustomerGrpBatchJobExport batchExporter = new V_CustomerGrpBatchJobExport();


// initialize captions
str taskCaption = strFmt(“@DMF:DMFExportInBatchCaption”, definitionGroupId);
// job caption can be specified in the prompt
str userInputCaption = strLRTrim(batchExporter.batchInfo().parmCaption());
str jobCaption = userInputCaption? userInputCaption : taskCaption;


// Indicate ready status for batch run

// Schedule batch

You can download the exported file from job history panel in Data management workspace.

The advantage here is, you attach this class to a action menuitem and add it into a menu.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s