Synchronising Data in Business Central with Microsoft Dataverse

When you integrate Dataverse with Business Central, you can decide whether to synchronise data in selected fields of Business Central (such as customers, contacts, and sales people) with equivalent rows in Dataverse (such as accounts, contacts, and users). Depending on the type of row, you can synchronise data from Dataverse to Business Central, or vice versa. For more information, see Integrating with Dynamics 365 Sales.

Synchronisation uses the following elements:

  • Integration table mappings
  • Integration field mappings
  • Synchronisation rules
  • Coupled records

When synchronisation is set up you can couple Business Central records to Dataverse rows to synchronise their data. You can start a synchronisation manually, or based on a schedule. The following table provides an overview of the ways you can synchronise.

Type Method See
Manual synchronisation Synchronise on a row-by-row basis.

You can synchronise individual records in Business Central, such as a customer, with a corresponding Dataverse row, such as an account. This is typically how users will work with Dataverse data in Business Central.
Couple and Synchronise Records Manually
Synchronise on a table mapping basis.

You can synchronise all records in a Business Central table with an table Dataverse table.
Synchronise Individual Table Mappings
Synchronise all modified records for all table mappings.

You can synchronise all of the records that have been modified in Business Central tables since the last synchronisation.
Synchronising All Modified Records
Full synchronisation of all data for all table mappings.

You can synchronise all of the data in Business Central and Dataverse tables that are mapped, and create new records or rows in the destination solution for uncoupled records in the source solution.

Full synchronisation synchronises all data and ignores coupling. Typically, you do a full synchronisation when you set up the integration and only one of solutions contains data. A full synchronisation can also be useful in a demonstration environment.
Run a Full Synchronisation
Scheduled synchronisation Synchronise all changes to data for all table mappings.

You can synchronise Business Central with Dataverse on scheduled intervals by setting up jobs in the job queue.
Schedule a Synchronisation

Note

The synchronisation between Dataverse and Business Central is based on the scheduled execution of job queue entries and does not guarantee real time data consistency between two services. For real time data conistency you should explore Business Central Virtual Tables or Business Central APIs.

Standard table mapping for synchronisation

Tables in Dataverse, such as accounts, are integrated with equivalent types of tables in Business Central, such as customers. To work with Dataverse data you set up links, called couplings, between tables in Business Central and Dataverse.

The following table lists the standard mapping between tables in Business Central and Dataverse.

Tip

You can reset configuration changes made to integration table and field mappings to their default settings by selecting the mappings, then choosing Use Default Synchronisation Setup.

Business Central Dataverse Synchronisation Direction Default Filter
Salesperson/Purchaser User Dataverse -> Business Central Dataverse contact filter: Status is No, User Licensed is Yes, Integration user mode is No
Customer Account Business Central -> Dataverse and Dataverse -> Business Central Dataverse account filter: Relationship Type is Customer and Status is Active. Business Central filter: Blocked is blank (Customer is not blocked).
Vendor Account Business Central -> Dataverse and Dataverse -> Business Central Dataverse account filter: Relationship Type is Vendor and Status is Active. Business Central filter: Blocked is blank (Vendor is not blocked).
Contact Contact Business Central -> Dataverse and Dataverse -> Business Central Business Central contact filter: Type is Person and the contact is assigned to a company. Dataverse contact filter: The contact is assigned to a company and the parent customer type is Customer.
Currency Transaction Currency Business Central -> Dataverse

Note

The Dataverse actions will not be available on pages, for example, the Customer Card page, for records that do not respect the table filter on the integration table mapping.

Tip for admins: viewing table mappings

You can view the mapping between the tables in Dataverse and Business Central on the Integration Table Mappings page, where you can also apply filters. You define the mapping between the fields in Business Central tables and the columns in Dataverse tables on the Integration Field Mapping page, where you can add additional mapping logic. For example, this can be useful if you need to troubleshoot synchronisation.

Use virtual tables to get more data

When you're setting up your integration, you can use virtual tables to make more data available in Dataverse, without help from a developer.

A virtual table is a custom table that has columns and rows that contain data from an external data source, such as Business Central. The columns and rows in a virtual table look like a regular table, however, the data isn't stored in a physical table in the Dataverse database. Instead, the data is retrieved at runtime.

Note

Business Central contains objects that are also called virtual tables. Those table objects are not related to the virtual tables that you use with Dataverse.

To learn more about virtual tables, go to the following articles:

To use virtual tables, you must install the Business Central Virtual Entity app from AppSource.

After you install the app, you can enable virtual tables from one of the following pages in Business Central:

  • When you run the Set up Dataverse connection assisted setup guide, you can use the Dataverse Available Virtual Tables page to select multiple virtual tables. Afterward, the tables are available in Dataverse and the PowerApps Maker Portal.
  • From the Dataverse Connection Setup, Virtual Tables, and Available Virtual Tables pages.
  • From the Power App Maker Portal.

Synchronise data from multiple companies or environments

You can synchronise data from multiple Business Central companies or environments with a Dataverse environment. In multi-company synchronisation scenarios, there are several things to consider.

Set company IDs

When you synchronise records, we set a company ID on the Dataverse entity to clarify the Business Central company the records came from. Integration table mappings have integration table filter fields that take the company ID into account. To include a table mapping in a multi-company setup, on the Integration Table Mapping page, choose the Multi-Company Synchronisation Enabled checkbox. The setting optimises how integration table filter fields filter company IDs in a multi-company setup.

For integration table mappings that synchronise documents, such as orders, quotes, and opportunities, if you choose the Multi-Company Synchronisation Enabled checkbox the integration only considers entities that have the company ID of the current Business Central company. To synchronise documents, for example, between Business Central and Sales, users in Sales must specify the company ID on the documents. Otherwise, the documents won't synchronise.

For all other integration table mappings, choosing the Multi-Company Synchronisation Enabled checkbox removes the filter on company ID. The synchronisation will consider related entities, regardless of their company ID.

Specify the synchronisation direction

If you enable multi-company support on an integration table mapping, we recommend that you set the direction of the mapping to FromIntegration. If you set the direction to ToIntegration or Bidirectional, it's a good idea to use Table Filter and Integration Table Filter to control which entities synchronise with which company. It's also a good idea to use match-based coupling to avoid creating duplicate records. To learn more about match-based coupling, go to Customise the match-based coupling.

Use unique numbers

If your number series doesn't guarantee that primary key values are unique to each company, we recommend that you use prefixes. To start using prefixes, create a transformation rule on the integration field mapping. To learn more about transformation rules, go to Handle differences in field values.

See Also

Couple and Synchronise Records Manually
Schedule a Synchronisation
Integrating with Dynamics 365 Sales

Find free e-learning modules for Business Central here