Skip to content

Commit 11112d6

Browse files
adding alerts to readme
1 parent 80a5a58 commit 11112d6

File tree

1 file changed

+60
-31
lines changed

1 file changed

+60
-31
lines changed

.github/README.md

Lines changed: 60 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ v2 breaking changes are [here](/.github/BREAKING_CHANGES_V2.md). List of new fea
115115
* [Download file](#download-file)
116116
* [Delete file](#delete-file)
117117
* [Work with Dataverse Search API](#work-with-dataverse-search-api)
118-
* [Search](#search)
118+
* [Query (previosly known as Search)](#query)
119119
* [Suggest](#suggest)
120120
* [Autocomplete](#autocomplete)
121121
* [Retrieve CSDL $metadata document](#retrieve-csdl-metadata-document)
@@ -295,11 +295,11 @@ serverUrl | `string` | The url to Dataverse API server, for example: https://con
295295
timeout | `number` | Sets a number of milliseconds before a request times out.
296296
useEntityNames | `boolean` | Indicates whether to use entity logical names instead of collection logical names during requests.
297297

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.
300300
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).
303303
304304
**ApiConfig** Properties:
305305

@@ -348,8 +348,9 @@ Please use [DynamicsWebApi Wiki](../../../wiki/) for an object reference. It is
348348

349349
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/).
350350

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.
353354
354355
Property Name | Type | Operation(s) Supported | Description
355356
------------ | ------------- | ------------- | -------------
@@ -420,7 +421,8 @@ top | `number` | Limit the number of results returned by using the $top system q
420421
All requests to Web API that have long URLs (more than 2000 characters) are automatically converted to a Batch Request.
421422
This feature is very convenient when you make a call with big Fetch XMLs. No special parameters needed to do a convertation.
422423

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 :)
424426
425427
### Create a table row
426428

@@ -755,7 +757,8 @@ const records = response.value;
755757
756758
It is possible to count records separately from RetrieveMultiple call. In order to do that use the following snippet:
757759
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.
759762
760763
```ts
761764
const count = await dynamicsWebApi.count({
@@ -1069,13 +1072,15 @@ await dynamicsWebApi.callAction(actionRequest);
10691072
10701073
Batch Operations bundle multiple requests into a single one and have the following advantages:
10711074
1072-
* Reduces a number of requests sent to the Web API server. `Each user is allowed up to 60,000 API requests, per organization instance, within five minute sliding interval.` [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. `Each user is allowed up to 6,000 API requests, per organization instance, within 5-minute sliding window.` [More Info](https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/api-limits)
10731076
* 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.
10741077
* All operations within a batch request run consequently (FIFO).
10751078
10761079
DynamicsWebApi provides a straightforward way to execute Batch Operations which may not always be simple to compose.
10771080
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)
10791084
10801085
The following example bundles 2 retrieve multiple operations and an update:
10811086
@@ -1165,7 +1170,8 @@ const salesorderId = responses[0];
11651170
11661171
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.
11671172
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.
11691175
11701176
### Use Content-ID inside a request payload
11711177
@@ -1203,7 +1209,9 @@ As mentioned before, by default, all operations that modify data: CREATE, UPDATE
12031209
12041210
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`.
12051211
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: `Error identified in Payload provided by the user for Entity :'<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: `Error identified in Payload provided by the user for Entity :'<entity name>'`.
12071215
12081216
**Per batch operation:**
12091217
@@ -1278,7 +1286,9 @@ const responses = await dynamicsWebApi.executeBatch();
12781286
12791287
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.
12801288
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.
12821292
12831293
```ts
12841294
dynamicsWebApi.startBatch();
@@ -1477,7 +1487,8 @@ const schemaName = entityMetadata.SchemaName;
14771487
14781488
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).
14791489
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.
14811492
14821493
```ts
14831494
const entityKey = "LogicalName='new_accountname'";
@@ -1488,7 +1499,8 @@ entityMetadata.DispalyName.LocalizedLabels[0].Label = "New Bank Account";
14881499
await dynamicsWebApi.updateEntity({ data: entityMetadata });
14891500
```
14901501
1491-
**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:
14921504
14931505
```ts
14941506
await dynamicsWebApi.callAction({
@@ -1593,7 +1605,8 @@ const schemaName = attributeMetadata.SchemaName;
15931605
15941606
### Update Columns
15951607
1596-
**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.
15971610
15981611
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)
15991612
@@ -1634,9 +1647,11 @@ await dynamicsWebApi.updateAttribute({
16341647
});
16351648
```
16361649
1637-
**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.
16381652
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)
16401655
16411656
### Retrieve Multiple Columns
16421657
@@ -1818,7 +1833,8 @@ const relationshipId = await dynamicsWebApi.createRelationship({ data: newRelati
18181833
```
18191834
### Update Relationship
18201835
1821-
**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.
18221838
18231839
```ts
18241840
const metadataId = "10cb680e-b6a7-e811-816a-480fcfe97e21";
@@ -2025,7 +2041,8 @@ const id = await dynamicsWebApi.createGlobalOptionSet({
20252041
20262042
### Update Global Option Set
20272043
2028-
**Important!** Publish your changes after update, otherwise a label won't be modified.
2044+
> [!IMPORTANT]
2045+
> Publish your changes after update, otherwise a label won't be modified.
20292046
20302047
```ts
20312048
let key = "6e133d25-abd1-e811-816e-480fcfeab9c1";
@@ -2164,15 +2181,21 @@ const isDeleted = await dynamicsWebApi.deleteRecord({
21642181
21652182
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).
21662183
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.
21682190
21692191
To set a Search API version use: `new DynamicsWebApi({ searchApi: { version: "2.0" }})`.
21702192
21712193
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.
21722194
21732195
_Examples below follow Microsoft's official documenation._
21742196
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.
21762199
21772200
### Query
21782201
@@ -2349,13 +2372,14 @@ const result = await dynamicsWebApi.suggest({
23492372
23502373
### Autocomplete
23512374
2352-
> [!WARNING]
2375+
> [!WARNING]
23532376
> **Checked: May 11th, 2025.**
23542377
> Something is wrong with this Search API endpoint. Does not matter what requests are done, I always get an error:
23552378
>
23562379
> `Invalid expression: Unsupported function call: search.ismatchscoring. This function is only supported in the Search API. Parameter name: $filter.`
23572380
>
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.
2382+
> Let me know if this gets resolved, I will remove the warning.
23592383
>
23602384
> P.S. Neither v1, v2 nor `searchautocomplete` action are working.
23612385

@@ -2427,9 +2451,10 @@ The `csdlDocument` will be the type of `string`. DynamicsWebApi does not parse t
24272451

24282452
`v2.3.0+`
24292453

2430-
**Note!** This feature is still in **preview** in the Dataverse (checked: May 4th, 2025). I would also recommend to get familiar with an [official documentation](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/background-operations?tabs=webapi).
2454+
> [!NOTE]
2455+
> This feature is still in **preview** in the Dataverse (checked: May 4th, 2025). I would also recommend to get familiar with an [official documentation](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/background-operations?tabs=webapi).
24312456

2432-
_Use background operations to send requests that Dataverse processes asynchronously. Background operations are useful when you don't want to maintain a connection while a request runs._
2457+
> Use background operations to send requests that Dataverse processes asynchronously. Background operations are useful when you don't want to maintain a connection while a request runs.
24332458

24342459
This feature currently works with **custom api actions only**.
24352460

@@ -2454,7 +2479,8 @@ const backgroundOperationId = response.backgroundOperationId;
24542479
### Check the status
24552480
The status of a background operation can be checked in 2 ways: by querying a `backgroundoperations` table or by polling the status monitor resource.
24562481

2457-
**Note!** Status Monitor is NOT a Dataverse Web API and therefore has a different behavior and is not going to be available in the Power Pages.
2482+
> [!NOTE]
2483+
> Status Monitor is NOT a Dataverse Web API and therefore has a different behavior and is not going to be available in the Power Pages.
24582484

24592485
For example, if we take a `backgroundOperationId` from a previous example, we can get the status this way:
24602486

@@ -2715,7 +2741,8 @@ If you are developing CRM Web Resources with TypeScript (and are not using NPM),
27152741
-- tsconfig.json
27162742
```
27172743

2718-
**Important!** Make sure that you include `types` folder in your `tsconfig.json`:
2744+
> [!IMPORTANT]
2745+
> Make sure that you include `types` folder in your `tsconfig.json`:
27192746
```json
27202747
"include": [
27212748
"./src/**/*",
@@ -2812,7 +2839,9 @@ the config option "formatted" will enable developers to retrieve all information
28122839
- [X] Implement [Dataverse Search API 1.0](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/search/legacy). `Added in v.2.0.0`
28132840
- [X] Allow custom headers to be passed to the request [#151](https://github.com/AleksandrRogov/DynamicsWebApi/issues/151). `Added in v.2.1.0`
28142841
- [X] Support Microsoft Power Pages. `Added in v.2.1.0`
2815-
- [ ] Support Search API 2.0 [#174](https://github.com/AleksandrRogov/DynamicsWebApi/issues/174). `Coming with v.2.3.0`
2842+
- [X] Background Operations for custom actions. `Added in v.2.3.0`
2843+
- [X] Support Search API 2.0 [#174](https://github.com/AleksandrRogov/DynamicsWebApi/issues/174). `Added in v.2.3.0`
2844+
- [ ] Support for the [session token](https://learn.microsoft.com/en-ca/power-apps/developer/data-platform/use-elastic-tables?tabs=webapi#work-with-the-session-token). `Coming in v.2.3.1`
28162845
- [ ] Custom requests.
28172846

28182847
Many more features to come!
@@ -2832,4 +2861,4 @@ And if you would like to contribute to the project you may do it in multiple way
28322861
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,
28332862
then please feel free to use PayPal or GitHub Sponsors. My PayPal button: [![PayPal.Me](/.github/extra/paypal.png)](https://paypal.me/alexrogov), GitHub button can be found on the project's page.
28342863

2835-
All contributions are greatly appreciated!
2864+
All contributions are greatly appreciated!

0 commit comments

Comments
 (0)