Loading...

Dynamics 365 Dataverse Change Tracking feature

Dynamics 365 Dataverse Change Tracking feature
Dynamics 365 Dataverse Change Tracking feature Guowei Mon, 02/20/2023 - 10:11
Body

Hi, Guys,

Today I would like to share the Change Tracking feature of Dynamics 365 CRM. 

Why enable Change Tracking?

Change Tracking enables incremental export, only records that have changed are exported.

In addition, you can export or retrieve a selected set of data, and then keep the external data warehouse in sync.

Suppose we have a lot of integrations of D365 CRM with other external systems. We need to keep track of changes done after the last synchronization of data and integrate only those changes to the downstream systems. For this scenario, Change Tracking is the best solution.

How to enable Change Tracking?

You can enable Change tracking for both system and custom tables(entities).

Once you enable the Track Changes you cannot disable it.

Using New UI Power Apps Settings

1, Expand Advanced Options.

    For the Create scenario, On the New table page.

    For the Update scenario, select a table, and then in Table Properties select Properties. In the Edit table page, expand Advanced Options.

2, In the For this table section, enable the Track Changes checkbox.

Dynamics 365 Dataverse Change Tracking feature

3, Save and Publish.

 

Using legacy settings

1, Navigate to Customizations-> Customize the System.

2, Select an entity, and under Data Services, select the Change Tracking checkbox.

Dynamics 365 Dataverse Change Tracking feature

How to custom query for Change Tracking

In this section, I will show you how to query the Chang Tracing data in the different scenarios and show the response data structure.

First of all, let's take a look at RetrieveEntityChangesRequest and RetrieveEntityChangesResponse classes.

RetrieveEntityChangesRequest

Input parameters

DataVersion is very import to only retrieve the changed data.

Set it as empty for the first time query, then return all records.

Dynamics 365 Dataverse Change Tracking feature

RetrieveEntityChangesResponse

Dynamics 365 Dataverse Change Tracking feature

Prerequisite

An entity enabled the Change Tracking feature.

Create Scenario:

1, Create a new record named Test1 

Test1

2, Execute below C# code to query the change data.

Request

 

We got 1 record as a NeworUpdatedEntity Item.

NeworUpdatedEntity

The message also returns a DataToken that we can use in the RetrieveEntityChangesRequest, so that when we execute this request the next time, it returns data for those changes that occurred since the last execution of the request.

DataToken

If retrieve again with the DataToken value, then no records were retrieved.

NoChanges

 

Update Scenario:

update the Name to Test1-a.

 Test1-a

then execute the query with the previous DataVersion.

Only 1 record was retrieved, and all the columns responded as the result.

Only 1 record was retrieved

 

Delete Scenario

Delete the previous record Test1-a and create a new record Test2.

Execute the query code with the previous DataVersion

2 items were retrieved, 1 is NewOrUpdatedEntity, and 1 for RemovedItem.

Dynamics 365 Dataverse Change Tracking feature

Multiple updates within the same record.

If we change the Name field from Test2 to Test2-1, then update to Test2-1-1.

The last change was responded to as the result.

The last change was responded

END

Hope this will help.

Thanks for reading.

Regards

Dynamics 365 Dataverse Change Tracking feature

Image
/sites/default/files/2023-03/dataverse_cdc.png

Published on:

Learn more
Need help with this product?

We can help you with Dynamics 365 Dataverse Change Tracking feature

If you want help implementing, troubleshooting, or improving this product, contact us and we’ll point you in the right direction.

Featured Articles | Dynamics Chronicles
Featured Articles | Dynamics Chronicles

Welcome to our blog, the content is entirely dedicated to Microsoft Dynamics 365, CRM, Power Platform, Common Data Service (CDS) but also Azure. Follow us !

Share post:

Related posts

Generative pages in model-driven apps: a practical guide

What generative pages are, where they stand in November 2026, the two ways to build them, the code they produce, and the limits to plan for.

1 day ago

Big Update — CRMJetty Dynamics 365 Portal Now Comes with Powerful New Integrations

Enterprise portals are evolving rapidly. They are no longer mere portals through which CRM records can be viewed. Portals are now expected to ...

7 months ago

Power Apps Code Apps in Practice: Recreating Model-Driven App Patterns

Power Apps Code Apps went from preview to general availability in record time. With that, Microsoft has sent a clear signal that it is taking ...

8 months ago

Use XRM type definition in your Javascript file

We implement Javascript webresource for form scripting (form onload, field on change,...). Our code need to follow the official document Xrm o...

9 months ago

Dataverse Functions Deep Dive

Microsoft released in 2024 Dataverse low-code plugins. The promise was great : writing plugins using low-code tools. No need to have developme...

10 months ago

Dataverse : Get Audit Storage by table

Dynamics 365 auditing feature logs changes made to records, allowing you to view the details of those changes at any time. Whenever a record i...

10 months ago

D365 Sales -2025 Wave release

In this post, we highlight the latest releases from Microsoft D365 Sales' 2025 Wave updates. For a detailed breakdown, click here. Public Prev...

10 months ago

10 Ways Dynamics 365 Calendar Boosts Productivity for Sales & Support Teams

In today’s fast-paced business environment, time is the most valuable resource for both sales and support teams. Managing appointments, meetin...

10 months ago

Newsletter

Get the latest Dynamics 365 and Power Platform content in your inbox

A curated digest of community blogs, product news, videos, and podcasts — delivered without the noise.

Weekly updates Unsubscribe anytime Fresh community picks
We use your email only for the newsletter and you can unsubscribe at any time.
By subscribing, you agree to the privacy policy.