You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: powerapps-docs/developer/data-platform/optional-parameters.md
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "Use optional parameters (Microsoft Dataverse) | Microsoft Docs"
3
3
description: "Use optional parameters to control operation behaviors"
4
-
ms.date: 05/27/2023
4
+
ms.date: 06/28/2023
5
5
ms.reviewer: jdaly
6
6
ms.topic: article
7
7
author: divkamath
@@ -222,6 +222,9 @@ More information:
222
222
223
223
Use the `tag` parameter to include a shared variable value that is accessible within a plug-in. This extra information allows a plug-in to apply logic that depends on the client application.
224
224
225
+
> [!NOTE]
226
+
> This parameter is intended for client applications to be able to set any value they wish. No Microsoft feature should require that you set a specific value in your client application code to enable different behaviors.
227
+
225
228
To access the value in a plug-in, use the [IExecutionContext.SharedVariables collection](xref:Microsoft.Xrm.Sdk.IExecutionContext.SharedVariables)
Copy file name to clipboardExpand all lines: powerapps-docs/developer/data-platform/use-change-tracking-synchronize-data-external-systems.md
+27-21Lines changed: 27 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
---
2
-
title: "Use change tracking to synchronize data with external systems (Microsoft Dataverse) | Microsoft Docs"# Intent and product brand in a unique string of 43-59 chars including spaces
3
-
description: "The change tracking feature provides a way to keep the data synchronized in an efficient manner by detecting what data has changed since the data was initially extracted or last synchronized"# 115-145 characters including spaces. This abstract displays in the search result.
4
-
ms.date: 04/19/2023
2
+
title: "Use change tracking to synchronize data with external systems (Microsoft Dataverse) | Microsoft Docs"
3
+
description: "The change tracking feature provides a way to keep the data synchronized in an efficient manner by detecting what data has changed since the data was initially extracted or last synchronized."
4
+
ms.date: 06/23/2023
5
5
ms.reviewer: pehecke
6
6
ms.topic: article
7
-
author: Peakerbl # GitHub ID
7
+
author: paulliew
8
8
ms.subservice: dataverse-developer
9
-
ms.author: peakerbl # MSFT alias of Microsoft employees only
9
+
ms.author: paulliew
10
10
search.audienceType:
11
11
- developer
12
12
contributors:
@@ -22,23 +22,29 @@ The change tracking feature in Microsoft Dataverse provides a way to keep the da
22
22
23
23
Before retrieving the changes for a table, make sure that the change tracking is enabled for that table.
24
24
25
-
You can check whether this feature is enabled or enable it by using [Power Apps](https://make.powerapps.com/?utm_source=padocs&utm_medium=linkinadoc&utm_campaign=referralsfromdoc). Select **Data** > **Tables** and the specific table. Under **Advanced options** you will find the **Track changes** property.
25
+
You can check whether this feature is enabled or enable it by using [Power Apps](https://make.powerapps.com/?utm_source=padocs&utm_medium=linkinadoc&utm_campaign=referralsfromdoc). Select **Data** > **Tables** and the specific table. Under **Advanced options** you'll find the **Track changes** property.
26
26
27
-
You can set this programmatically by setting the <xref:Microsoft.Xrm.Sdk.Metadata.EntityMetadata.ChangeTrackingEnabled?text=EntityMetadata.ChangeTrackingEnabled Property> to `True`.
27
+
You can set this programmatically by setting the [EntityMetadata.ChangeTrackingEnabled Property](xref:Microsoft.Xrm.Sdk.Metadata.EntityMetadata.ChangeTrackingEnabled) to `True`.
28
28
29
29
> [!NOTE]
30
30
> Once change tracking has been enabled for a table, it is not possible to disable it.
31
31
32
32
For more information on how to use [Power Apps](https://make.powerapps.com/?utm_source=padocs&utm_medium=linkinadoc&utm_campaign=referralsfromdoc): [Create and edit tables using Power Apps](../../maker/data-platform/create-edit-entities-portal.md)
33
33
34
-
There are two ways to check whether change tracking is enabled for a table using Web API.
34
+
There are two ways to check whether change tracking is enabled for a table using the Dataverse Web API.
35
35
36
-
1. You can query `EntityDefinitions` with the following GET request:
36
+
1. You can query `EntityDefinitions` with the following `GET` request:
37
37
38
38
```http
39
39
GET [Organization URI]/api/data/v9.2/EntityDefinitions?$select=SchemaName&$filter=ChangeTrackingEnabled eq true
40
40
```
41
41
42
+
There are system tables with change tracking enabled, for example [Auditing (Audit)](reference/entities/audit.md). You can use the following query to see the full list:
43
+
44
+
```http
45
+
GET [Organization URI]/api/data/v9.2/EntityDefinitions?$filter=ChangeTrackingEnabled eq true and IsCustomEntity eq false&$select=LogicalName
46
+
```
47
+
42
48
More information: [Query table definitions using the Web API](webapi/query-metadata-web-api.md)
43
49
44
50
1. Find this information in the Web API $metadata service document. The annotation `Org.OData.Capabilities.V1.ChangeTracking` is set for entity sets that have change tracking enabled.
@@ -49,7 +55,7 @@ There are two ways to check whether change tracking is enabled for a table using
49
55
GET [Organization URI]/api/data/v9.2/$metadata?annotations=true
50
56
```
51
57
52
-
Those entity sets which represent tables where change tracking is enabled will have this annotation:
58
+
Those entity sets that represent tables where change tracking is enabled have this annotation:
@@ -63,7 +69,7 @@ There are two ways to check whether change tracking is enabled for a table using
63
69
64
70
### Tables not eligible for change tracking
65
71
66
-
Some tables cannot be enabled for change tracking. You can check if a table is eligible for change tracking by checking the [EntityMetadata.CanChangeTrackingBeEnabled](xref:Microsoft.Xrm.Sdk.Metadata.EntityMetadata.CanChangeTrackingBeEnabled) managed property value. To see which tables cannot be enabled for change tracking, use this Web API query:
72
+
Some tables can't be enabled for change tracking. You can check if a table is eligible for change tracking by checking the [EntityMetadata.CanChangeTrackingBeEnabled](xref:Microsoft.Xrm.Sdk.Metadata.EntityMetadata.CanChangeTrackingBeEnabled) managed property value. To see which tables can't be enabled for change tracking, use this Web API query:
67
73
68
74
```http
69
75
GET [Organization URI]/api/data/v9.2/EntityDefinitions?$select=SchemaName,ChangeTrackingEnabled&$filter=ChangeTrackingEnabled eq false and CanChangeTrackingBeEnabled/Value eq false
@@ -76,9 +82,9 @@ More information:
76
82
77
83
## Retrieve changes for a table using the Web API
78
84
79
-
Changes made in tables can be tracked using Web API requests by adding the `Prefer: odata.track-changes` header. This header requests that a _delta link_be returned which can subsequently be used to retrieve table changes.
85
+
Changes made in tables can be tracked using Web API requests by adding the `Prefer: odata.track-changes` header. This header requests that a _delta link_is returned which can later be used to retrieve table changes.
80
86
81
-
Delta links are opaque, service-generated links that the client uses to retrieve subsequent changes to a result. They are based on a defining query that describes the set of results for which changes are being tracked. For example, the request that generated the results containing the delta link. The delta link encodes the collection of tables for which changes are being tracked, along with a starting point from which to track changes. More information: [Oasis OData Version 4.0 - Delta Links](https://docs.oasis-open.org/odata/odata/v4.0/cs01/part1-protocol/odata-v4.0-cs01-part1-protocol.html#_Toc365046305)
87
+
Delta links are opaque, service-generated links that the client uses to retrieve subsequent changes to a result. They're based on a defining query that describes the set of results for which changes are being tracked. For example, the request that generated the results containing the delta link. The delta link encodes the collection of tables for which changes are being tracked, along with a starting point from which to track changes. More information: [Oasis OData Version 4.0 - Delta Links](https://docs.oasis-open.org/odata/odata/v4.0/cs01/part1-protocol/odata-v4.0-cs01-part1-protocol.html#_Toc365046305)
82
88
83
89
### Retrieve changes in tables using Web API example
The `@odata.deltaLink` Uri returned from the above example can be used to fetch changes in tables. In this example a new account was created and an existing account deleted. The delta link returned from the previous request fetches these changes, as shown in the example below.
125
+
The `@odata.deltaLink` Uri returned from the above example can be used to fetch changes in tables. In this example, a new account was created and an existing account deleted. The delta link returned from the previous request fetches these changes, as shown in the example below.
### Query options not supported in Change Tracking Web API request
171
177
172
-
System query options `$filter`, `$orderby`, `$expand` and `$top`are not supported when using the `Prefer: odata.track-changes` header in Web API request. An error message: `The \"${filter|orderby|expand|top}\" query parameter isn't supported when Change Tracking is enabled.`will be returned when using these query options in the Web API request.
178
+
System query options `$filter`, `$orderby`, `$expand` and `$top`aren't supported when using the `Prefer: odata.track-changes` header in a Web API request. An error message: `The \"${filter|orderby|expand|top}\" query parameter isn't supported when Change Tracking is enabled.`is returned when using these query options in the Web API request.
173
179
174
180
## Retrieve changes for a table using .NET SDK
175
181
176
-
When change tracking is enabled for a table, you can use the `RetrieveEntityChanges` message with the <xref:Microsoft.Xrm.Sdk.Messages.RetrieveEntityChangesRequest?text=RetrieveEntityChangesRequest Class> to retrieve the changes for that table.
182
+
When change tracking is enabled for a table, you can use the `RetrieveEntityChanges` message with the [RetrieveEntityChangesRequest Class](xref:Microsoft.Xrm.Sdk.Messages.RetrieveEntityChangesRequest) to retrieve the changes for that table.
177
183
178
184
The first time this message is used it returns all records for the table and that data can be used to populate the external storage. The message also returns a version number that will be sent back with the next use of the `RetrieveEntityChanges` message so that only data for those changes that occurred since that version will be returned.
179
185
180
186
You should be aware of the following constraints when retrieving changes for a table:
181
187
182
-
- Only one table will be tracked in retrieve changes. If `RetrieveEntityChanges` is executed with no version / or token, the server will treat it as the system minimum version, returning all of the records as new. Deleted objects won't be returned.
183
-
- Changes will be returned if the last token is within a default value of 30 days. This is controlled by the value of the [Organization table ExpireChangeTrackingInDays column](reference/entities/organization.md#BKMK_ExpireChangeTrackingInDays) and can be changed. If there are unprocessed changes older than the configured value, the system will throw an exception.
184
-
- If a client has a set of changes for a table, say version 1, a record is created and deleted prior to the next query for changes, they will get the deleted item even if they didn't have the item to begin with.
185
-
- Records are retrieved in the order determined by server side logic. Usually, the caller will always get all new or updated records first (sorted by version number) followed by deleted records. If there are 3000 records created or updated and 2000 records deleted, Dataverse returns a collection of 5000 records, which have the first 3000 entries comprised of new or updated records and the last 2000 entries for deleted records.
188
+
- Only one table is tracked in retrieve changes. If `RetrieveEntityChanges` is executed with no version / or token, the server treats it as the system minimum version, returning all of the records as new. Deleted objects are not returned.
189
+
- Changes are returned if the last token is within a default value of 30 days. This duration is controlled by the value of the [Organization table ExpireChangeTrackingInDays column](reference/entities/organization.md#BKMK_ExpireChangeTrackingInDays) and can be changed. If there are unprocessed changes older than the configured value, the system throws an exception.
190
+
- If a client has a set of changes for a table, say version 1, a record is created and deleted before the next query for changes, they'll get the deleted item even if they didn't have the item to begin with.
191
+
- Records are retrieved in the order determined by server side logic. Usually, the caller will get all new or updated records first (sorted by version number) followed by deleted records. If there are 3,000 records created or updated and 2,000 records deleted, Dataverse returns a collection of 5,000 records, which have the first 3,000 entries comprised of new or updated records and the last 2,000 entries for deleted records.
186
192
- If the new or updated item collection is greater than 5000, the user can page through the collection.
187
-
- The calling user must have organization level read access to the table. If the user has limited read access, the system will throw a privilege check error.
193
+
- The calling user must have organization level read access to the table. If the user has limited read access, the system throws a privilege check error.
0 commit comments