An example of the endpoint URL for a development environment is: https://usnconeboxax1aos.cloud.onebox.dynamics.com/soap/services/UserSessionService?wsdl .
If you have an issue with the service that you created you will get a “page cannot be displayed” error when you open the WSDL endpoint URL in a browser. Since no additional information is displayed in the browser this can be very frustrating to resolve. When this happens the first place to check for clues is the environment event log.
Open event viewer and go to Application and Services Logs > Microsoft > Dynamics > AX-IntegrationServices > Channel:Operational (Microsoft-Dynamics-AX-IntegrationServices/Operational)
In the Operational Event Log, Details tab, you will find exception details such as issues with Data Contract serialization. I recently saw a case were someone used the same name for two different members of a data contract. This caused an System.Runtime.Serialization.InvalidDataContractException where “multiple members with the same name in one type are not supported“. In this case adjusting the data members names in the data contract class and re-building the service group resolved the issue.
This post explains how to implement the same data entity export functionality provided in the Data Management workspace in a form or a menu item.
Below is form dialog that I created to research how to create data entities and run the export functionality directly from X++ code and using standard DMF classes.
Creating an export data project
The first code sample is how I created the export data project. The definition group name is anything that you want. For the source name (data format EXCEL, CSV etc) you can use the standard lookup method DMFQuickImportExportFormHelper.buildSourceNameControlLookup(). For the entity name there is another standard lookup DMFUtil::lookupEntity(this).
/// Create DMF Processing group to export 'Customer Groups'
/// <param name = "_groupName">Definition group name</param>
/// <param name = "_sourceName">Export file type e.g. CSV</param>
/// <param name = "_entityName">Entity Name</param>
public static void createNewDefinitionGroup(DMFDefinitionGroupName _groupName, DMFSourceName _sourceName, DMFEntityName _entityName)
DMFEntity dmfEntity = DMFEntity::find(_entityName);
DMFDataSource dmfDataSource = DMFDataSource::find(_sourceName);
if (dmfEntity && dmfDataSource)
DMFDefinitionGroupName dmfDefinitionGroupName = _groupName;
Description description = _groupName;
//Create data project
"", //Sample file
"@SYS6047", //"All fields"
NoYes::Yes, //Skip staging
NoYes::Yes, //Export to File. Set Yes to create a definition group of operation type Export
"", //Sheet lookup
NoYes::No, //Truncate Entity Data
Exporting the data definition group
To export the definition group we use the DMFPackageExporter class after creating a new DMF Definition Group Execution.
DMFDefinitionGroup definitionGroup = DMFDefinitionGroup::find("My demo export");
DMFExecutionId dmfExecutionId = DMFUtil::setupNewExecution(definitionGroup.DefinitionGroupName);
Description description = strFmt('Execution - %1 for Definition Group - %2', dmfExecutionId, definitionGroup.DefinitionGroupName);
//Create new dmf execution group for the new execution
if (DMFDefinitionGroupExecution::insertOrDisplay(definitionGroup, dmfExecutionId, description, false))
dmfDefinitionGroupExecution = DMFDefinitionGroupExecution::find(definitionGroup.DefinitionGroupName, dmfDefinitionGroupEntity.Entity, dmfExecutionId);
DMFExportImportDataContract dmfDataContract = new DMFExportImportDataContract();
DMFPackageExporter packageExporter = new DMFPackageExporter();
//Download file for the newly created dmf execution group
To send the file to the user from the DMF Definition Group Execution table we use DMFEntityExportDetails to get the download URL.
Another useful class is the DMFFormBrowser. This opens the entity query dialog and lets the user add filters. You can also code your own ranges on the query and then package it to attached to the DMF Group Execution. You would use this code before calling the exportToPackageV2 method shown previously.
queryData = DMFUtil::getDefaultQueryForEntityV3(dmfDefinitionGroupEntity.Entity, dmfDefinitionGroupEntity.DefinitionGroup);
//Show query dialog
queryData = DMFFormBrowser::showQuery(queryData);
//Update Query filter on DMF Definition Group
if(queryData != connull())
dmfDefinitionGroupExecution.QueryData = queryData;
//Save updated query for next time
dmfDefinitionGroupEntity.QueryData = queryData;
This blog post is a code dump of a file upload dialog for D365 FO. There are various around, but I could not find a complete example so I decided to share my own. This is a single class extending the RunBase class, which has a file upload control and then parses the CSV file returned from the IO stream. No data entities are used although you can modify the code and use them.
Privacy & Cookies Policy
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.