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
@@ -295,11 +295,11 @@ serverUrl | `string` | The url to Dataverse API server, for example: https://con
295
295
timeout | `number` | Sets a number of milliseconds before a request times out.
296
296
useEntityNames | `boolean` | Indicates whether to use entity logical names instead of collection logical names during requests.
297
297
298
-
**Note!**
299
-
`serverUrl` and `onTokenRefresh` are required when DynamicsWebApi is used in a Node.js application.
298
+
> [!NOTE]
299
+
> `serverUrl` and `onTokenRefresh` are required when DynamicsWebApi is used in a Node.js application.
300
300
301
-
**Important!**
302
-
If you are using `DynamicsWebApi`**outside Microsoft Dynamics 365** and set `useEntityNames` to `true`**the first request** to Web Api will fetch `LogicalCollectionName` and `LogicalName` from `EntityMetadata` for all entities. It does not happen when `DynamicsWebApi` is used in Microsoft Dynamics 365 Web Resources (there is no additional request, no impact on perfomance).
301
+
> [!IMPORTANT]
302
+
> If you are using `DynamicsWebApi`**outside Microsoft Dynamics 365** and set `useEntityNames` to `true`**the first request** to Web Api will fetch `LogicalCollectionName` and `LogicalName` from `EntityMetadata` for all entities. It does not happen when `DynamicsWebApi` is used in Microsoft Dynamics 365 Web Resources (there is no additional request, no impact on perfomance).
303
303
304
304
**ApiConfig** Properties:
305
305
@@ -348,8 +348,9 @@ Please use [DynamicsWebApi Wiki](../../../wiki/) for an object reference. It is
348
348
349
349
The following table describes all __possible__ properties that can be set in a `request` object. Some parameters may still be absent in a table, please refer to [DynamicsWebApi Wiki](../../../wiki/).
350
350
351
-
__Please note!__ Not all operations accept all properties and if
352
-
by mistake an invalid property has been specified you will receive either an error saying that the request is invalid or the response will not have expected results.
351
+
> [!NOTE]
352
+
> Not all operations accept all properties and if by mistake an invalid property has been specified
353
+
> you will receive either an error saying that the request is invalid or the response will not have expected results.
353
354
354
355
Property Name | Type | Operation(s) Supported | Description
@@ -420,7 +421,8 @@ top | `number` | Limit the number of results returned by using the $top system q
420
421
All requests to Web API that have long URLs (more than 2000 characters) are automatically converted to a Batch Request.
421
422
This feature is very convenient when you make a call with big Fetch XMLs. No special parameters needed to do a convertation.
422
423
423
-
**Heads up!** This feature may cause an issue in Microsoft Power Pages because Batch Requests are not supported there out of the box. Please keep your requests short :)
424
+
> [!NOTE]
425
+
> This feature may cause an issue in Microsoft Power Pages because Batch Requests are not supported there out of the box. Please keep your requests short :)
424
426
425
427
### Create a table row
426
428
@@ -755,7 +757,8 @@ const records = response.value;
755
757
756
758
It is possible to count records separately from RetrieveMultiple call. In order to do that use the following snippet:
757
759
758
-
**IMPORTANT!** The count value does not represent the total number of entities in the system. It is limited by the maximum number of entities that can be returned.
760
+
> [!IMPORTANT]
761
+
> The count value does not represent the total number of entities in the system. It is limited by the maximum number of entities that can be returned.
Batch Operations bundle multiple requests into a single one and have the following advantages:
1071
1074
1072
-
* Reduces a number of requests sent to the Web API server. `Eachuserisallowedupto60,000APIrequests, perorganizationinstance, withinfiveminuteslidinginterval.` [More Info](https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/api-limits)
1075
+
* Reduces a number of requests sent to the Web API server. `Eachuserisallowedupto6,000APIrequests, perorganizationinstance, within5-minuteslidingwindow.` [More Info](https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/api-limits)
1073
1076
* Provides a way to run multiple operations in a single transaction. If any operation that changes data (within a single changeset) fails all completed ones will be rolled back.
1074
1077
* All operations within a batch request run consequently (FIFO).
1075
1078
1076
1079
DynamicsWebApi provides a straightforward way to execute Batch Operations which may not always be simple to compose.
1077
1080
1078
-
**Please Note!** By default, all operations that modify data, such as: CREATE, UPDATE, UPSERT, PUT and DELETE - are automatically made atomic (combined in Change Sets). You can change this behaviour by setting `inChangeSet` to `false`. [More Info](#controlling-change-sets)
1081
+
> [!NOTE]
1082
+
> By default, all operations that modify data, such as: CREATE, UPDATE, UPSERT, PUT and DELETE - are automatically made atomic (combined in Change Sets).
1083
+
> You can change this behaviour by setting `inChangeSet` to `false`. [More Info](#controlling-change-sets)
1079
1084
1080
1085
The following example bundles 2 retrieve multiple operations and an update:
Note that if you are making a request to a navigation property (`collection: "customerid_contact"`), the request won't have a response, it is an OOTB Web API limitation.
1167
1172
1168
-
**Important!** DynamicsWebApi automatically assigns value to a `Content-ID` if it is not provided, therefore, please set your `Content-ID` value less than 100000.
1173
+
> [!IMPORTANT]
1174
+
> DynamicsWebApi automatically assigns value to a `Content-ID` if it is not provided, therefore, please set your `Content-ID` value less than 100000.
1169
1175
1170
1176
### Use Content-ID inside a request payload
1171
1177
@@ -1203,7 +1209,9 @@ As mentioned before, by default, all operations that modify data: CREATE, UPDATE
1203
1209
1204
1210
In some cases this can be an undesirable behaviour and with v2 there are several ways to make those operations non-atomic: per batch operation and per request. Let's use a code sample above and make **all** operations non-atomic. It can be done by setting `inChangeSet` property to `false`.
1205
1211
1206
-
**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>'`.
1212
+
> [!IMPORTANT]
1213
+
> `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!
1214
+
> If `$1` parameter was used outside of Change Set you will get an error similar to the following: `ErroridentifiedinPayloadprovidedbytheuserforEntity :'<entity name>'`.
The first two requests will be atomic (included in a Change Set) and the last one will be executed separately. So, if for some reason, there was an error during creation of an Email record, the whole operation won't be rolled back and the Contact and Order records will be created in the system.
1280
1288
1281
-
**Be extra careful** with an order of requests in a Batch Operation, especially if it has a combination of atomic and non-atomic operations in it. For example, if in an example above we move the creation of an Email record above Order - it will create 2 separate change sets for the Contact and for the Order records.
1289
+
> [!IMPORTANT]
1290
+
> **Be extra careful** with an order of requests in a Batch Operation, especially if it has a combination of atomic and non-atomic operations in it.
1291
+
> For example, if in an example above we move the creation of an Email record above Order - it will create 2 separate change sets for the Contact and for the Order records.
Microsoft recommends to make changes in the entity metadata that has been priorly retrieved to avoid any mistake. I would also recommend to read information about **MSCRM.MergeLabels** header prior updating metadata. More information about the header can be found [here](https://msdn.microsoft.com/en-us/library/mt593078.aspx#Anchor_2).
1479
1489
1480
-
**Important!** Make sure you set **`MetadataId`** property when you update the metadata, DynamicsWebApi uses it as a primary key for the EntityDefinition record.
1490
+
> [!IMPORTANT]
1491
+
> Make sure you set **`MetadataId`** property when you update the metadata, DynamicsWebApi uses it as a primary key for the EntityDefinition record.
1481
1492
1482
1493
```ts
1483
1494
const entityKey ="LogicalName='new_accountname'";
@@ -1488,7 +1499,8 @@ entityMetadata.DispalyName.LocalizedLabels[0].Label = "New Bank Account";
**Important!** When you update a table definition, you must publish your changes. [More Info](https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/publish-customizations). In our case we need to do an additional request to publish changes:
1502
+
> [!IMPORTANT]
1503
+
> When you update a table definition, you must publish your changes. [More Info](https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/publish-customizations). In our case we need to do an additional request to publish changes:
**Important!** Make sure you set **`MetadataId`** property when you update the metadata, DynamicsWebApi use it as a primary key for the EntityDefinition record.
1608
+
> [!IMPORTANT]
1609
+
> Make sure you set **`MetadataId`** property when you update the metadata, DynamicsWebApi use it as a primary key for the EntityDefinition record.
1597
1610
1598
1611
The following example will update only common properties availible in [AttributeMetadata](https://msdn.microsoft.com/en-us/library/mt607551.aspx) entity. If you need to update specific properties of Attributes with type that inherit from the AttributeMetadata you will need to cast the attribute to the specific type. [More Info](https://msdn.microsoft.com/en-us/library/mt607522.aspx#Anchor_4)
**Important!** Make sure you include the attribute type in the update function as well.
1650
+
> [!IMPORTANT]
1651
+
> Make sure you include the attribute type in the update function as well.
1638
1652
1639
-
**Important!** When you update an attribute, you must publish changes in CRM. [More Info](https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/publish-customizations)
1653
+
> [!IMPORTANT]
1654
+
> When you update an attribute, you must publish changes in CRM. [More Info](https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/publish-customizations)
**Important!** Make sure you set **`MetadataId`** property when you update the metadata, DynamicsWebApi use it as a primary key for the EntityDefinition record.
1836
+
> [!IMPORTANT]
1837
+
> Make sure you set **`MetadataId`** property when you update the metadata, DynamicsWebApi use it as a primary key for the EntityDefinition record.
DynamicsWebApi can be used to call Dataverse Search API and utilize its powerful Query, Suggest and Autocomplete capabilities. Before using, I highly recommend to get familiar with it by reading an [official documentation](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/search/overview?tabs=webapi).
2166
2183
2167
-
**Important!** This documentation is based on the Dataverse Search API v2.0 (added in `v2.3.0`). If you would like to find documentation for v1.0, please check [here](https://github.com/AleksandrRogov/DynamicsWebApi/blob/v2.2.1/.github/README.md#work-with-dataverse-search-api). Just keep in mind, that some properties in the request and response objects are marked as deprecated to encourage usage of the v2.0 properties. Deprecated properties and requests will be removed in the next major version.
2184
+
> [!IMPORTANT]
2185
+
> This documentation is based on the Dataverse Search API v2.0 (added in `v2.3.0`).
2186
+
> If you would like to find documentation for v1.0, please check [here](https://github.com/AleksandrRogov/DynamicsWebApi/blob/v2.2.1/.github/README.md#work-with-dataverse-search-api).
2187
+
> Just keep in mind, that some properties in the request and response objects are marked as deprecated to encourage usage of the v2.0 properties.
2188
+
>
2189
+
> Deprecated properties and requests will be removed in the next major version.
2168
2190
2169
2191
To set a Search API version use: `newDynamicsWebApi({ searchApi: { version: "2.0" }})`.
2170
2192
2171
2193
All functions: Query, Suggest and Autocomplete, - can be called with a single `string` parameter "a search term". But to utilize the full power of the relevance search use a common property `query` that is available in all 3 requests.
2172
2194
2173
2195
_Examples below follow Microsoft's official documenation._
2174
2196
2175
-
**Note!** All request properties are `camelCase`, even though in Dataverse Search API v2.0 they are lowercase.
2197
+
> [!NOTE]
2198
+
> All request properties are `camelCase`, even though in Dataverse Search API v2.0 they are lowercase.
2176
2199
2177
2200
### Query
2178
2201
@@ -2349,13 +2372,14 @@ const result = await dynamicsWebApi.suggest({
2349
2372
2350
2373
### Autocomplete
2351
2374
2352
-
> [!WARNING]
2375
+
> [!WARNING]
2353
2376
> **Checked: May 11th, 2025.**
2354
2377
> Something is wrong with this Search API endpoint. Does not matter what requests are done, I always get an error:
2355
2378
>
2356
2379
> `Invalidexpression: Unsupportedfunction call: search.ismatchscoring. This function is only supported in the Search API. Parameter name: $filter.`
2357
2380
>
2358
-
This looks like and ootb issue, they are using an unsupported operator `search.ismatchscoring` in a [Search Service's Autocomplete query](https://learn.microsoft.com/en-us/azure/search/search-query-odata-full-text-search-functions) function. Let me know if this gets resolved, I will remove the warning.
2381
+
> This looks like and ootb issue, they are using an unsupported operator `search.ismatchscoring` in a [Search Service's Autocomplete query](https://learn.microsoft.com/en-us/azure/search/search-query-odata-full-text-search-functions) function.
_UsebackgroundoperationstosendrequeststhatDataverseprocessesasynchronously. Backgroundoperationsareusefulwhenyoudon't want to maintain a connection while a request runs._
2457
+
> UsebackgroundoperationstosendrequeststhatDataverseprocessesasynchronously. Backgroundoperationsareusefulwhenyoudon't want to maintain a connection while a request runs.
thenpleasefeelfreetousePayPalorGitHub Sponsors. MyPayPalbutton: [](https://paypal.me/alexrogov), GitHub button can be found on the project's page.
0 commit comments