Editar

Compartilhar via


Synchronizing data in Business Central with Microsoft Dataverse

When you integrate Dataverse with Business Central, you can decide whether to synchronize 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 synchronize data from Dataverse to Business Central, or vice versa. For more information, see Integrating with Dynamics 365 Sales.

Synchronization uses the following elements:

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

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

Type Method See
Manual synchronization Synchronize on a row-by-row basis.

You can synchronize 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 Synchronize Records Manually
Synchronize on a table mapping basis.

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

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

You can synchronize 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 synchronization synchronizes all data and ignores coupling. Typically, you do a full synchronization when you set up the integration and only one of solutions contains data. A full synchronization can also be useful in a demonstration environment.
Run a Full Synchronization
Scheduled synchronization Synchronize all changes to data for all table mappings.

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

Note

The synchronization 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 synchronization

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, and then choosing Use Default Synchronization Setup.

Business Central Dataverse Synchronization 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 synchronization.

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.

Synchronize data from multiple companies or environments

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

Set company IDs

When you synchronize 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 Synchronization Enabled checkbox. The setting optimizes how integration table filter fields filter company IDs in a multi-company setup.

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

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

Specify the synchronization 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 synchronize 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 Customize 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 Synchronize Records Manually
Schedule a Synchronization
Integrating with Dynamics 365 Sales

Find free e-learning modules for Business Central here