Data templates in Microsoft Dynamics 365 Business Central let you control exactly which fields you synchronise from a master company to your subscriber companies. You can include only a selection of fields from a table instead of synchronising the entire record.
To create a data template, you give it a code, specify the table ID, and assign a sequence number that determines the order in which the table synchronises. The template starts with only the primary key field included.
You add fields through Setup and Select Fields from Table, where you can checkmark several fields at once. Once you release the template and the subscribers are added, the template is ready to be synchronised to those subscribers.
Creating a data template in Business Central
When you work as a master company and need to share data with subscriber companies, you don’t always want to push every field in a table. A data template lets you pick out only the fields you actually need to synchronise.
Start by going to Data Templates and pressing New. The first thing you enter is a code that defines what kind of data template this is. In this example, the template is for payment terms, so the code is simply set to “Payment Terms”.
You can leave the description blank for now. The description updates automatically as soon as you enter the table ID. For payment terms, the table ID is 3.
Next, you choose a sequence number. This number controls the order in which the table is synchronised relative to other tables, which matters when you have dependencies between tables.
Selecting which fields to include
When you first create the template, it contains only one field, because that’s the primary key. The primary key is always included by default.
To add more fields, go to Setup and choose Select Fields from Table. This gives you an overview of all the fields available in the table. You can add one field at a time, or you can checkmark several at once and include them all in the template.
In this example, fields 2 to 6 are checkmarked and included. Since the primary key is already part of the template, you leave it as it is and press OK. The selected fields are now added to the data template.
Verifying the records before release
Once the fields are in place, the data template is ready to be released. After releasing it, you can go to Related and view the Record Data. This shows you that the template has now included the records you saw in the original table, so you can confirm the right data is being captured before it goes anywhere.
Adding subscribers and synchronising
With the template released, the next step is to add subscribers to it. Once the subscribers are in place, the template is ready to be synchronised to them. This is how the selected fields and records make their way from the master company out to the subscriber companies.
Q&A
Can I synchronise only some of the fields in a table?
Yes. A data template lets you include only the fields you want to synchronise instead of the whole record. You select the fields through Setup and Select Fields from Table, where you can checkmark several at once.
Is the primary key included automatically in a data template?
Yes. When you create a new data template, it already contains the primary key field. You only need to add the additional fields you want to synchronise.
What does the sequence number on a data template do?
The sequence number determines the order in which the table is synchronised to the subscribers. This is useful when tables depend on each other and need to be processed in a specific order.
How do I check the data before synchronising the template?
After releasing the template, go to Related and open Record Data. This shows the records the template has captured from the table, so you can confirm the correct data before it is synchronised to subscribers.
What steps are needed before a data template synchronises to subscribers?
First create the template with a code, table ID, and sequence number. Then add the fields you want, release the template, and add the subscribers. Once the subscribers are added, the template is ready to be synchronised.
