Coupling and synchronization records between Field Service and Business Central
In this unit, you learn about the concept of coupling, which is a way of linking rows in Dataverse tables to records in Business Central tables. For example, when you have an account in Dataverse, you can couple it with a customer record in Business Central. This has two main advantages:
It enables synchronization, which is the process of updating the data in both systems to match each other. You can use synchronization jobs to automate this process and keep your data consistent.
It allows users to access records or rows in one system from the other system. For example, you can open a customer record in Business Central from an account in Dataverse, or vice versa. This requires that you first integrate the two systems using the integration tools.
You can create couplings in two ways: either automatically, by using the synchronization jobs, or manually, by editing the record in Business Central and selecting the corresponding row in Dataverse.
Filter records and rows
One of the features of integrating Business Central and Dataverse is that you can access the data from one system in the other system. For example, if you have a customer record in Business Central, you can view and edit it from an account in Dataverse, or the other way around. To do this, you need to integrate the two systems using the integration tools first.
When you integrate the systems, you need to create couplings between the records or rows in each system. A coupling is a link that connects a record in Business Central to a row in Dataverse, or vice versa. You can create couplings in two ways:
Automatically, by using the synchronization jobs
Manually, by editing the record in Business Central and selecting the corresponding row in Dataverse.
Sometimes, you might not want to synchronize all the data for a specific table in Dataverse or Business Central. For example, you might only want to synchronize the customers that are active, or the users that have a certain role.
To do this, you can set up filters to limit the data that is synchronized. You set up filters on the Integration Table Mappings page, where you can specify the conditions for the data to be synchronized.
To set up filters, follow these steps:
Open the Search icon, and type Integration Table Mappings. Then, choose the related link to open the page.
On the page, you can see the list of table mappings that define how the data is synchronized between the systems. Select the table mapping that you want to set up filters for.
To filter the Business Central records, enter the filter expression in the Table Filter field. For example, to filter the customers by status, you can enter
Status=Active.To filter the Field Service rows, enter the filter expression in the Integration Table Filter field. For example, to filter the users by role, you can enter
Role=Salesperson.Save your change and run the synchronization job to apply the filters.
In some cases, you might want to create new records or rows in the destination system for each row or record in the source system that isn't already coupled. For example, you might want to create a new salesperson in Business Central for every user in Dataverse that isn't coupled with a salesperson. You can do this by setting up the table mapping to create new records.
For example, the SALESPEOPLE - Dynamics 365 Sales synchronization job uses
the table mapping SALESPEOPLE. The synchronization job copies data from users
in Dataverse to salespersons in Business Central. If you set up the table mapping
to create new records, for every user in Dataverse that isn't already coupled to
a salesperson in Business Central, a new salesperson row is created in Business
Central.
Create new records
One of the features of the integration synchronization jobs is that they can create new records or rows in the destination system for each record or row in the source system that isn't coupled with an existing one. This means that you can use the integration to populate data in one system based on the data in another system. For example, you can use this feature to create a new salesperson in Business Central for every user in Dataverse that doesn't have a corresponding salesperson. To enable this feature, you need to configure the table mapping to create new records.
Let's look at an example of how this works. The SALESPEOPLE - Dynamics 365 Sales synchronization job uses the table mapping SALESPEOPLE. This table mapping
defines how the data from the users table in Dataverse is mapped to the
salespersons table in Business Central. When you run the synchronization job,
the integration copies the data from the Dataverse users to the Business Central
salespersons. If you configure the table mapping to create new records, the
integration also checks if there are any users in Dataverse that don't have a
matching salesperson in Business Central. For each of these users, the integration
creates a new salesperson row in Business Central, using the data from the user
row in Dataverse.
Use configuration templates on table mappings
One of the ways to customize the integration synchronization jobs is to enable them to create new records or rows in the destination system for each record or row in the source system that doesn't have a corresponding match. This feature allows you to use integration to transfer data from one system to another and create new entities in the process.
For instance, you can use this feature to generate a new salesperson entity in Business Central for every user entity in Dataverse that doesn't have a related salesperson. To turn on this feature, you need to adjust the settings of the table mapping to allow the creation of new records.
We use the SALESPEOPLE - Dynamics 365 Sales synchronization job, which
utilizes the table mapping SALESPEOPLE. This table mapping defines the
rules for how the data from the users table in Dataverse is mapped to the
salespersons table in Business Central.
When you run the synchronization job, the integration copies the data from the Dataverse users to the Business Central salespersons. If you modify the table mapping to enable the creation of new records, the integration also verifies if there are any users in Dataverse that don't have a corresponding salesperson in Business Central. For each of these users, the integration generates a new salesperson row in Business Central, using the data from the user row in Dataverse.
You can also apply configuration templates to table mappings to define the default values for new records or rows created in Business Central or Dataverse. For each table mapping, you can select a configuration template to use for new Business Central records and another template to use for new Dataverse rows.
If you install the default synchronization setup, most of the table
mappings already have configuration templates assigned to them for
creating new records or rows in either system. For example, the table
mapping for Business Central customers and Dynamics 365 Sales accounts
typically uses two configuration templates: CDSCUST and CDSACCOUNT.
CDSCUST creates and synchronizes new customers in Business Central
based on accounts in Dynamics 365 Sales. You can create this template
by copying an existing configuration template for customers. The CDSCUST
template is created only if there's an existing configuration template
and the Currency Code field in the template is empty. If a field in the
configuration template has a value, the value overrides the value in the
mapped column for the Dataverse account. For example, if the Country/Region
column in an account in Dataverse has U.S. and the Country/Region field
in the configuration template has GB, then GB is used as the Country/Region
for the customer in Business Central.
CDSACCOUNT creates and synchronizes new accounts in Dataverse based on
customers in Business Central. You can create this template by copying an
existing configuration template for accounts. The CDSACCOUNT template is
created only if there's an existing configuration template and the Currency
field in the template is empty. If a field in the configuration template
has a value, the value overrides the value in the mapped column for the
Business Central customer. For example, if the Country/Region column in a
customer in Business Central has GB and the Country/Region field in the
configuration template has U.S., then U.S. is used as the Country/Region
for the account in Dataverse.