Technical6 min read

Create a custom D365 F&O data entity and export it with DMF

Create a custom data entity in Visual Studio (wizard, staging, key), synchronise it, then export it from Data management. Steps and pitfalls.

The short answer

To expose your Dynamics 365 Finance & Operations tables to import/export: in Visual Studio, add a "Data Entity" item to the project, fill in the wizard (primary data source, public name, "Enable public API" for OData and "Enable data management capabilities" for import/export), pick the fields and the natural key, then build with database synchronisation. The wizard creates the entity and its staging table.

In the application, refresh the entity list if needed, then create an export project in the Data management workspace: pick the entity, the file format and an optional filter, run the export and download the file or package.

Step 1: create the entity in Visual Studio

Based on the Microsoft Learn tutorial "Build and consume data entities":

  1. Create a finance and operations project linked to your model.
  2. Add a new Data Entity item. The entity name must not contain "_" or digits, or you risk mapping errors later.
  3. In the wizard, choose the primary data source, the public name, the public collection name, and tick the OData and/or data management options. The data management option generates the staging table.
  4. Select the fields. Rename them to a readable public contract (or use "Convert labels to field names"). Clear container fields you do not need.
  5. Mark the field used as the natural key as mandatory; it will form the EntityKey.
  6. Add fields from a related data source if needed (for example the address), then finish.

Give the entity a unique label: Microsoft warns that two entities with the same label may go missing from the list after a refresh.

Step 2: build, synchronise, check

Entities are created as SQL views, along with their staging table: you must synchronise the database. Set the project property "Synchronize database on build" to True, then build.

Then open the entity in the designer to check the properties, the key (EntityKey) and, for a data source joined by foreign key, the Is Read Only property (set to No to allow writes). Also check the generated staging table.

After deploying to an environment where data management is already used, run the manual refresh: Data management > Framework parameters > Entity settings > Refresh entity list. Otherwise the new entity does not appear.

Step 3: export with DMF

  1. Open the Data management workspace and select the Export tile.
  2. Name the project, add your entity, choose the target format (Microsoft lists 14 export formats) and apply a filter if needed.
  3. Save, then export: a job is created, with status tracking and record counts.
  4. Download the result: one file per entity, or a package (zip with the files, a header and a manifest) that can be reimported as is.

Import works the same way (Import tile, upload the file, check the mapping with "View map"). If the export fails, check the execution log; if the message asks you not to skip staging, turn off "Skip staging" for that entity.

Common mistakes and performance

  • More than 26 joins in the entity: that is the default limit; beyond it the entity fails. For exports, Microsoft recommends staying at 0-3 joins where possible; from 8 joins performance is slow.
  • Computed columns containing joins: add the tables as data sources instead. See D365 F&O data entity computed columns.
  • A postLoad method or a virtual field: the export must then go through staging, which slows it down.
  • Container fields exported without implementing getFieldsToBeConvertedToFile.
  • An entity name with "_" or digits, or a duplicate label.
  • Forgetting "Refresh entity list" after a deployment.

Having the entity generated

Entity, staging table, computed columns, security and tests: Skalp AI generates this development from your requirement, delivered to your Azure DevOps and validated by your IT lead. See D365 data entities and DMF packages, the bigger picture in building X++ without a consultant in 2026, and the Basic, Pro and Max plans. If the entity is meant for an AI agent, also read Dynamics 365 ERP MCP server: agents read and write through data entities first.

Sources

Frequently asked questions

Why doesn't my new data entity appear in Data management?

After deploying to an environment already in use, you must run "Refresh entity list" manually (Data management > Framework parameters > Entity settings). Also check that data management is enabled on the entity and that its label is unique.

Do you need the staging table for exports?

Not in general. Microsoft advises using it only if the entity has a postLoad method, a virtual field, bitmaps to export, or columns tied to disabled configuration keys.

How many joins can a data entity have?

The default limit is 26 joins, and Microsoft advises against raising it. For exports, aim for 0 to 3 joins for good performance.

Ready to transform your D365?

Join the CIOs who develop their D365 tickets in 1h for 1 credit (≈ €400 on Basic, €200 on Pro).