Map integration tables

Completed

In this unit, you'll learn about integration tables, which are tables in the Business Central database that link to tables in Field Service, such as the Accounts table. Integration tables have fields that match the columns in the Field Service tables, so that you can synchronize data between the two apps. For example, the Account integration table connects the data in Business Central with the data in the Accounts table in Field Service. To synchronize data between Business Central and Field Service, you need to have an integration table mapping for each Field Service table that you want to include in the integration.

When you set up the connection between Business Central and Field Service, some default table mappings are created automatically. However, you can modify the table mappings to suit your needs. For example, you can change which fields are mapped, or add or remove tables from the integration. You can also use the Standard Table Mapping for Synchronization page to see the default mappings and how they work. If you want to undo your changes and go back to the default mappings, you can use the Use Default Synchronization Setup action on the Integration Table Mappings page.

Additional mappings

You may want to add more integration table mappings for some common settings that you want to keep consistent between Business Central and Field Service. These settings are payment terms, shipment methods, and shipping agents. Payment terms specify the conditions under which you expect to receive or make payments. Shipment methods indicate how you deliver or receive goods. Shipping agents are the companies that provide the shipment services. To enable the integration of these settings, you need to activate a feature in Business Central called Feature Update: Map to option sets in Field Service without code. This feature lets you create integration table mappings for the payment terms (PAYMENT TERMS), shipment methods (SHIPMENT METHOD), and shipping agents (SHIPPING AGENT) tables without writing any code. By creating these mappings, you can make sure that the data in these tables is synchronized between Business Central and Field Service, and that you have the same policies for both apps.

Map integration fields

You might want to map the fields on the tables you already mapped. Field mappings are important because they connect the fields in Business Central tables with the corresponding columns in Field Service tables, and they control how the data is synchronized between the two systems. For example, if you map the Name field in the Customer table in Business Central with the Full Name column in the Account table in Field Service, the integration copies the names of the customers from one system to the other.

Business Central provides some default field mappings for the standard table mappings, but you can modify them or create your own field mappings if you need to. To view or edit the field mappings, you can go to the Integration Table Mappings page, select a table mapping, and then choose the Mapping action and the Fields option.

There are two ways to create field mappings: manually or automatically. If you create field mappings manually, you must select each field in Business Central and each column in Field Service that you want to map, and then choose the Map action. If you create field mappings automatically, you can use the criteria that Business Central provides to match multiple fields and columns based on their names, types, or values. For example, you can choose to map all the fields and columns that have the same name and type, or that have the same value options. To create field mappings automatically, you can use the Auto-Map action and select one of the options from the drop-down list.

Differences in field values

One of the data integration challenges is that the fields you want to map might have different values in different systems.

For example, let us say you want to map the language code field in Dynamics 365 Sales to the language code field in Business Central. In Dynamics 365 Sales, the language code for the United States is "U.S.", but in Business Central, it's "US."

How can you make sure that the data is synchronized correctly?

You need to use transformation rules to convert the values from one system to another. Transformation rules are rules you define for the fields you want to map, and they specify how to transform the values during synchronization. You can create transformation rules on the Integration Table Mappings page by choosing Mapping, and then Fields. You can use some of the predefined rules that Business Central provides, or you can create your own rules if you have specific requirements. Transformation rules are useful when you have fields that have different formats, units, or codes in different systems.

Missing option values

Suppose you want to integrate Field Service with Business Central. Business Central also has fields that have a fixed set of values, and these fields are called Option fields. For example, you might have an Option field for the status of an order, and the values could be open, shipped, invoiced, or canceled. Option fields are like option set columns, but they have some differences in how they're stored and displayed in Business Central.

When you want to synchronize data between Field Service and Business Central, you need to map the fields that have the same or similar meaning in both systems. For example, if you want to map the color option set column in Field Service to the color Option field in Business Central so that when you create or update a product in one system, the color information is also updated in the other system.

However, you might encounter a problem if the values in the option set column and the Option field aren't the same. For example, what if Field Service has a value of "purple" in the color option set column, but Business Central doesn't have that value in the color Option field? How can you handle this situation?

The answer is that you need to use transformation rules to convert the values from one system to another during synchronization.

Transformation rules are rules that you define for the fields that you want to map, and they specify how to change the values when they're transferred from one system to another.

For example, you might have a transformation rule that says that if the value in the color option set column is "purple," then change it to "magenta" when you synchronize it to the color Option field in Business Central. You can create transformation rules on the Integration Table Mappings page by choosing Mapping, and then Fields. You can use some of the predefined rules that Business Central provides, or you can create your own rules if you have specific requirements. Transformation rules are useful when you have fields that have different formats, units, or codes in different systems.

However, transformation rules aren't always enough to handle all the possible scenarios. Sometimes, you might have values in the option set column that aren't mapped to any values in the Option field. For example, what if Field Service has a value of "orange" in the color option set column, but Business Central doesn't have that value in the color Option field? And what if Business Central has a value of "brown" in the color Option field, but Field Service doesn't have that value in the color option set column? In these cases, you can't use transformation rules to convert the values, because there's no corresponding value in the other system. So, what happens during synchronization?

The answer is that Business Central ignores the non-mapped values and appends them to the related Business Central table and the DATAVERSE Option Mapping system table. The DATAVERSE Option Mapping system table stores information about the option set columns and Option fields mapped between Field Service and Business Central and shows the values not mapped. You can use this table to manually handle the missing values later. For example, you can add the missing values to the option set column or the Option field in either system, then update the mapping in the DATAVERSE Option Mapping system table. This way, you can ensure that the data is synchronized correctly and consistently between Field Service and Business Central.