Allow Row version change tracking for tables and data entities
Important
Some or all of the functionality noted in this article is available as part of a preview release. The content and the functionality are subject to change. For more information about preview releases, see Service update availability.
A new change tracking option has been added to finance and operations apps. This option enables Microsoft Dataverse to be used for incremental synchronization of data. Change tracking is a prerequisite for several features, such as Data archival, Synapse integration, Mobile offline, and Relevance search. The eventual goal is to unify all existing finance and operations data synchronization frameworks into one that is based on Dataverse synchronization services.
Beginning in Microsoft Dynamics Finance 10.0.32, it's required to enable the Sql row version change tracking configuration key on the License configuration page.
Before you create or update data entities so that you can use them with row version change tracking, verify that all tables that are used as data sources for those entities allow for row version change tracking.
For information about how to create a new entity, see Build and consume data entities.
Enable row version change tracking for tables
You can enable the Allow Row Version Change Tracking option for tables by setting their metadata property to Yes. The property must be set to Yes for all tables that are used as data sources for a data entity to enable row version change tracking for that entity. During build operations, a SysRowVersionNumber column of the rowversion data type is added to the tables.
The SysRowVersionNumber column performs version stamping of table rows. SQL Server maintains a database-level counter that is incremented for each insert or update operation. Changes to a table row can be detected by comparing the current value in the SysRowVersionNumber column with the previous value.
Note
The SysRowVersionNumber column (which is also known as the rowversion column) is read-only in SQL Server. Therefore, direct SQL update statements, such as the following example, will break if they try to create or update this column.
INSERT INTO table2
SELECT * FROM table1
The SysRowVersionNumber column is controlled by the Sql row version configuration key in the License configuration form, System administration > Setup > Licensing > License configuration. In the unlikely event that custom SQL update statements are trying to create or update the column, it will be required to disable the configuration key until the issue is resolved. Configuration keys can only be edited in maintenance mode, see Maintenance mode.
Enable row version change tracking for data entities
You can enable the Allow Row Version Change Tracking option for data entities by setting their metadata property to Yes. Not all existing data entities are configured to support row version change tracking. The main limiting factor is the complexity of the entities. When Allow Row Version Change Tracking is set to Yes for a data entity, validation rules are evaluated at build time. However, we still recommend that you review and proactively apply these rules when you create or update entities.
ISVs and partners are recommended to always create new data entities when enabling Row version change tracking. This to avoid risks of existing custom extensions violating the validation rules below. Runtime validations will prevent new breaking extensions from being added once Allow row version is enabled
The following table describes the data entity validation rules.
When Allow Row Version Change Tracking is set to Yes for a data entity, the SysRowVersionNumber column of the primary table is added to the data entity view.
Track deletions and cleanup
Data entity row deletions are tracked by using the AifChangeTrackingDeletedObject table.
A system batch job that is named Delete tracking history clean-up cleans up any records in the AifChangeTrackingDeletedObject table that have exceeded the retention period. Records are deleted in batches until the time-out criterion is reached. By default, the job runs every day at 1:00 AM. However, you can configure the recurrence and frequency of the job at System Administration > Batch Jobs. Currently, the retention period is 10 days.
Retrieve row version entity changes
This change tracking feature is fully compatible with Dataverse change tracking; however, there are some differences. For example, changes for finance and operations apps are returned if the last token is within the default value of 10 days, not the value of 90 days that is used for Dataverse tables. For more information, see Use change tracking to synchronize data with external systems.
Feedback
Submit and view feedback for