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: .github/CHANGELOG.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,12 @@
1
+
<aname="v2.2.1"></a>
2
+
# [v2.2.1](https://github.com/AleksandrRogov/DynamicsWebApi/releases/tag/v2.2.1) - 20 Feb 2025
3
+
4
+
**Fixes**
5
+
- Wrong line endings in the batch request resulted in `InnerException : System.ArgumentException: Stream was not readable` when `inChangeSet` was set to `false`. [#183](https://github.com/AleksandrRogov/DynamicsWebApi/issues/183)
6
+
7
+
[Changes][v2.2.1]
8
+
9
+
1
10
<aname="v2.2.0"></a>
2
11
# [v2.2.0](https://github.com/AleksandrRogov/DynamicsWebApi/releases/tag/v2.2.0) - 09 Feb 2025
3
12
@@ -8,7 +17,7 @@
8
17
- Slightly optimized `dateReviver` function.
9
18
10
19
**Fixes**
11
-
- Modified `expand` property in the type definitions to accept a `string`. It could always accept a `string`instead of an array of expand objects.
20
+
- Modified `expand` property in the type definitions to accept a `string`. It could always accept a `string`together with an array of expand objects.
**Important!** Web API seems to have a limitation (or a bug) where it does not return the response with `returnRepresentation` set to `true`. It happens only if you are trying to return a representation of an entity that is being
1149
-
linked to another one in a single request. [More Info and examples is in this issue](https://github.com/AleksandrRogov/DynamicsWebApi/issues/112).
1186
+
**Important!** Web API seems to have a limitation (or a bug) where it does not return the response with `returnRepresentation` set to `true` when `expand` is provided with `update` or `upsert` operations. [More Details](#returnrepresentation-with-expand-throws-an-error)
1150
1187
1151
1188
### Controlling Change Sets
1152
1189
@@ -1156,7 +1193,7 @@ In some cases this can be an undesirable behaviour and with v2 there are several
1156
1193
1157
1194
**Important!** `contentId` can **only** be used inside the Change Sets. Any `contentId` set in a request won't be included in a non-atomic batch operation! If `$1` parameter was used outside of Change Set you will get an error similar to the following: `ErroridentifiedinPayloadprovidedbytheuserforEntity :'<entity name>'`.
**Important!** There seem to be a bug in Dynamics 365 Web Api (Checked: July 16, 2023) where it does not process the last operation in a batch request (Change Sets work fine). As a workaround, you can add any "GET" operation at the end to make it work, like in the following example. Please let me know if this bug was fixed.
1190
-
1191
-
Per request:
1226
+
**Per request:**
1192
1227
1193
1228
```ts
1194
1229
dynamicsWebApi.startBatch();
@@ -1203,19 +1238,12 @@ dynamicsWebApi.create({
1203
1238
inChangeSet: false//<--- do not include in a change set
1204
1239
});
1205
1240
1206
-
//this is a workaround to a D365 bug (checked on July 16, 2023)
These two samples do the same thing: make all requests non-atomic.
1244
+
The two examples above do the same thing: make all requests non-atomic.
1217
1245
1218
-
By setting `inChangeSet:false` per request gives more control over which operation should be included in a change set and which ones do not, for example:
1246
+
By setting `inChangeSet:false` per request gives more control over which operation should be included in a change set and which ones do not, for example:
1219
1247
1220
1248
```ts
1221
1249
dynamicsWebApi.startBatch();
@@ -1279,13 +1307,63 @@ Currently, there are some limitations in DynamicsWebApi Batch Operations:
1279
1307
* Operations that use pagination to recursively retrieve all records cannot be used in a 'batch mode'. These include: `retrieveAll`, `retrieveAllRequest`, `countAll`, `fetchAll`, `executeFetchXmlAll`.
1280
1308
You will get an error saying that the operation is incompatible with a 'batch mode'.
1281
1309
1282
-
There are also out of the box Web API limitations for batch operations:
1310
+
There are also out of the box Dataverse Web API limitations for batch operations:
1283
1311
1284
1312
* Batch requests can contain up to 1000 individual requests and cannot contain other batch requests.
1285
1313
* Not supported in Microsoft Power Pages. (checked June 2024)
1286
1314
1287
1315
You can find an official documentation that covers Web API batch requests here: [Execute batch operations using the Web API](https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/webapi/execute-batch-operations-using-web-api).
1288
1316
1317
+
1318
+
#### returnRepresentation with expand throws an error
1319
+
`checked: Feb2025`
1320
+
1321
+
The Dataverse Web API seems to have a limitation (or a bug) where it does not return the response with `returnRepresentation` set to `true` when `expand` is provided with `update` or `upsert` operations. The error itself is also very misleading:
As a workaround here, remove `returnRepresentation` from `update` or `upsert` and add a `retrieve` operation that returns a recently created/updated table with an `expand` at the end. This does not seem to impact a `create` operation.
Before working with metadata read [the following section from Microsoft Documentation](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/query-metadata-web-api).
@@ -2554,4 +2632,4 @@ And if you would like to contribute to the project you may do it in multiple way
2554
2632
gets improved and all raised tickets have been answered and fixed in a short amount of time. If you feel that this project has saved your time and you would like to support it,
2555
2633
then please feel free to use PayPal or GitHub Sponsors. My PayPal button: [](https://paypal.me/alexrogov), GitHub button can be found on the project's page.
0 commit comments