How to work with Change tracking in Dynamics CE (Data Verse/CDS)
Many time you want to retrieved changed records only for integration scenarios from ce. Change tracking feature comes handy in such cases.
Let’s check how does it works:
Step1: Enable change tracking on table from power apps portal: (It’s enabled already for account table in my case..!)
Step2: Make a CE rest api call with one extra header [Prefer odata.track-changes] (highlighted in below screenshot)
In response you’ll receive @odata.deltaLink token which have url which you can use to get difference/changes i.e. Create, Update, Delete operation done on account records.
Step3: Create 1 account record, modify 1 account record and delete 1 account record in CE:
Step4: Hit the deltalink url this time:
You’ll see that you’ll get the 3 records only. 1 Modified, 1 created and 1 deleted.
Along with result, you again got next @deltalink url which contains delta token using which you can get records changed post this call.
So this is how you can utilize the change tracking feature to only get the changes done in a table since your last call.
You would like to store the delta token (or url) received in last call to that you can pass that in next call.
Hope it helps..!!