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
Often applications need to ingest large amount of data into Dataverse in a short amount of time. Dataverse has a group of messages that are designed to achieve high throughput. With elastic tables, the throughput can be much higher.
17
+
Often applications need to ingest large amount of data into Dataverse in a short amount of time. Dataverse has a group of messages that are designed to achieve high throughput. With elastic tables, the throughput can be higher.
18
18
19
-
Bulk operations are optimized for performance when executing multiple write operations on the same table by taking a batch of rows as input in a single write operation. For elastic tables, we recommend sending 100 items in a batch. Multiple bulk operation can be run in parallel to achieve high throughput. More information [Send parallel requests](send-parallel-requests.md)
19
+
Bulk operations are optimized for performance when executing multiple write operations on the same table by taking a batch of rows as input in a single write operation. For elastic tables, we recommend sending 100 items in a batch. Multiple bulk operations can be run in parallel to achieve high throughput. More information [Send parallel requests](send-parallel-requests.md)
20
20
21
21
Elastic tables currently support the following messages for bulk operations:
22
22
@@ -183,6 +183,32 @@ public static OrganizationResponse DeleteMultiple(IOrganizationService service)
183
183
}
184
184
```
185
185
186
+
## Exception handling for elastic tables
187
+
188
+
Unlike standard tables, an error within a bulk operation with an elastic table doesn't roll back the entire request. It's possible for the operation to partially succeed and you can detect which records have failed from the ErrorDetails.
189
+
190
+
191
+
When you use the SDK, a [FaultException](xref:System.ServiceModel.FaultException%601) of type [OrganizationServiceFault](xref:Microsoft.Xrm.Sdk.OrganizationServiceFault) is thrown if a failure occurs. You can get the status of each record using the following code.
192
+
193
+
```csharp
194
+
if (ex.Detail.ErrorDetails.TryGetValue("Plugin.BulkApiErrorDetails", outobjecterrorDetails))
When using Web API, you need to pass the `Prefer` header with value `odata.include-annotations=*` or `odata.include-annotations=Microsoft.PowerApps.CDS.ErrorDetails.*`, which gives the status of each record. More information: [Include more details with errors](webapi/compose-http-requests-handle-errors.md#include-more-details-with-errors)
208
+
209
+
> [!NOTE]
210
+
> You can see the errors in the above format only when the errors have occurred while writing data and cannot capture errors occurred in Pre and Post plugins. More information: [Handling Exceptions](write-plugin-multiple-operation.md#handling-exceptions).
Copy file name to clipboardExpand all lines: powerapps-docs/developer/data-platform/files-images-overview.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ Dataverse provides several different ways to save binary data representing files
35
35
36
36
## Block certain types of files
37
37
38
-
You can block the types of files that can be uploaded by the extension or mime type.
38
+
You can block the types of files that can be uploaded by the extension or MIME type.
39
39
40
40
### Block files by extension
41
41
@@ -111,9 +111,9 @@ When anyone tries to upload a file using one of the blocked types, the following
111
111
> Number: `-2147205623`<br />
112
112
> Message: `The attachment is either not a valid type or is too large. It cannot be uploaded or downloaded.`
113
113
114
-
### Block or allow certain mime types
114
+
### Block or allow certain MIME types
115
115
116
-
You can block or allow upload of files based on mime types. More Information: [Mime Type Validation](/power-platform/admin/settings-privacy-security#mime-type-validation).
116
+
You can block or allow upload of files based on MIME types. More Information: [Mime Type Validation](/power-platform/admin/settings-privacy-security#mime-type-validation).
117
117
118
118
You can also query and modify this data programmatically. It's stored in the [Organization.BlockedMimeTypes](reference/entities/organization.md#BKMK_BlockedMimeTypes) and [Organization.AllowedMimeTypes](reference/entities/organization.md#BKMK_AllowedMimeTypes) columns. There's only one row in the organization table. You can use the SDK or Web API to query this data:
119
119
@@ -165,15 +165,15 @@ OData-Version: 4.0
165
165
}
166
166
```
167
167
168
-
If `allowedmimetypes` is set, `blockedmimetypes` is ignored. Only the mime types specified in `allowedmimetypes` are allowed.
168
+
If `allowedmimetypes` is set, `blockedmimetypes` is ignored. Only the MIME types specified in `allowedmimetypes` are allowed.
169
169
170
-
If `blockedmimetypes` isn't empty and `allowedmimetypes` is empty, the following error occurs when someone tries to upload a mime type that is in blocked mime types:
170
+
If `blockedmimetypes` isn't empty and `allowedmimetypes` is empty, the following error occurs when someone tries to upload a MIME type that is in blocked MIME types:
171
171
172
172
> Name: `MimeTypeBlocked`<br />
173
173
> Code: `0x80072522`<br />
174
174
> Message: `Operation not allowed as mime type image/svg+xml is blocked.`
175
175
176
-
If `allowedmimetypes` isn't empty, the following error occurs when someone tries to upload a mime type that isn't in `allowedmimetypes`:
176
+
If `allowedmimetypes` isn't empty, the following error occurs when someone tries to upload a MIME type that isn't in `allowedmimetypes`:
Copy file name to clipboardExpand all lines: powerapps-docs/developer/data-platform/webapi/create-entity-web-api.md
+32-25Lines changed: 32 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "Create a table row using the Web API (Microsoft Dataverse) | Microsoft Docs"
3
3
description: "Read how to create a POST request to send data to create a table row on Microsoft Dataverse using the Web API"
4
-
ms.date: 05/18/2023
4
+
ms.date: 06/14/2023
5
5
ms.service: powerapps
6
6
ms.topic: article
7
7
author: divkamath
@@ -26,13 +26,13 @@ Use a POST request to send data to create a table row (entity record). You can c
26
26
27
27
## Basic Create
28
28
29
-
This example creates a new account entity record. The response `OData-EntityId` header contains the Uri of the created entity.
29
+
This example creates a new account entity record. `accounts` is the entity set name for the [account EntityType](xref:Microsoft.Dynamics.CRM.account). The response `OData-EntityId` header contains the Uri of the created entity.
30
30
31
31
**Request**
32
32
33
33
```http
34
34
35
-
POST [Organization URI]/api/data/v9.0/accounts HTTP/1.1
To create a new entity record you must identify the valid property names and types. For all system tables and attributes (table columns), you can find this information in the topic for that entity in the [Dataverse table/entity reference](../reference/about-entity-reference.md). For custom tables or columns, refer to the definition of that table in the [CSDL $metadata document](web-api-service-documents.md#csdl-metadata-document). More information: [Web API EntityTypes](web-api-entitytypes.md)
61
+
To create a new entity record you must identify the valid [Entity set name](web-api-service-documents.md#entity-set-name), property names, and types. For all system tables and attributes (table columns), you can find this information in the article for that entity in the [Web API Entity Type Reference](xref:Microsoft.Dynamics.CRM.EntityTypeIndex). For custom tables or columns, refer to the definition of that table in the [CSDL $metadata document](web-api-service-documents.md#csdl-metadata-document). More information: [Web API EntityTypes](web-api-entitytypes.md)
62
62
63
63
<aname="bkmk_createWithDataReturned"></a>
64
64
65
65
## Create with data returned
66
66
67
-
You can compose your `POST` request so that data from the created record will be returned with a status of `201 (Created)`. To get this result, you must use the `return=representation` preference in the request headers.
67
+
You can compose your `POST` request so that data from the created record is returned with a status of `201 (Created)`. To get this result, you must use the `return=representation` preference in the request headers.
68
68
69
69
To control which properties are returned, append the `$select` query option to the URL to the entity set. You may also use `$expand` to return related entities.
70
70
71
71
> [!NOTE]
72
72
> Nested `$expand` on collection-valued navigation properties will not return data when used with the `return=representation` preference. More information: [Nested $expand on collection-valued navigation properties](query-data-web-api.md#nested-expand-on-collection-valued-navigation-properties)
73
73
74
-
When an entity is created in this way the `OData-EntityId` header containing the URI to the created record is not returned.
74
+
When an entity is created in this way, the `OData-EntityId` header containing the URI to the created record isn't returned.
75
75
76
76
This example creates a new account entity and returns the requested data in the response.
77
77
78
78
**Request**
79
79
80
80
```http
81
81
82
-
POST [Organization URI]/api/data/v9.0/accounts?$select=name,creditonhold,address1_latitude,description,revenue,accountcategorycode,createdon HTTP/1.1
82
+
POST [Organization URI]/api/data/v9.0/accounts?$select=name,creditonhold,address1_latitude,description,revenue,accountcategorycode,createdon
83
83
OData-MaxVersion: 4.0
84
84
OData-Version: 4.0
85
85
Accept: application/json
@@ -125,25 +125,25 @@ OData-Version: 4.0
125
125
126
126
## Create related table rows in one operation
127
127
128
-
You can create entities related to each other by defining them as navigation properties values. This is known as *deep insert*. This approach has two advantages. It is more efficient, replacing multiple simpler creation and association operations with one combined operation. Also, it is atomic where either the entire operation succeeds and all the related objects are created, or the operation fails and none are created.
128
+
You can create entities related to each other by defining them as navigation properties values. This pattern is known as *deep insert*. This approach has two advantages. It's more efficient, replacing multiple simpler creation and association operations with one combined *atomic*operation. An atomic operation succeeds or fails entirely.
129
129
130
130
As with a basic create, the response `OData-EntityId` header contains the Uri of the created entity. The URIs for the related entities created aren't returned. You can get the primary key values of the records if you use the `Prefer: return=representation` header so it returns the values of the created record. More information: [Create with data returned](#create-with-data-returned)
131
131
132
-
For example, the following request body posted to the `accounts` entity set will create a total of four new entities in the context of creating an account.
132
+
For example, the following request body posted to the `accounts` entity set creates a total of four new entities in the context of creating an account.
133
133
134
-
- A contact is created because it is defined as an object property of the single-valued navigation property `primarycontactid`.
134
+
- A contact is created because it's defined as an object property of the single-valued navigation property `primarycontactid`.
135
135
136
-
- An opportunity is created because it is defined as an object within an array that is set to the value of a collection-valued navigation property `opportunity_customer_accounts`.
136
+
- An opportunity is created because it's defined as an object within an array that is set to the value of a collection-valued navigation property `opportunity_customer_accounts`.
137
137
138
-
- A task is created because it is defined an object within an array that is set to the value of a collection-valued navigation property `Opportunity_Tasks`.
138
+
- A task is created because it's defined an object within an array that is set to the value of a collection-valued navigation property `Opportunity_Tasks`.
139
139
140
140
> [!NOTE]
141
141
> When creating a new table row, it is not possible to combine the row creation with the insert of a non-primary image. For a non-primary image to be added, the row must already exist.
142
142
143
143
**Request**
144
144
145
145
```http
146
-
POST [Organization URI]/api/data/v9.0/accounts HTTP/1.1
To associate new entities to existing entities when they are created you must set the value of navigation properties using the `@odata.bind` annotation.
187
+
To associate new entities with existing entities when they're created, you must set the value of navigation properties using the `@odata.bind` annotation.
188
188
189
-
The following request body posted to the `accounts` entity set will create a new account associated with an existing contact with the `contactid` value of `00000000-0000-0000-0000-000000000001` and two existing tasks with `activityid` values of `00000000-0000-0000-0000-000000000002` and `00000000-0000-0000-0000-000000000003`.
189
+
The following request body posted to the `accounts` entity set creates a new account associated with an existing contact with the `contactid` value of `00000000-0000-0000-0000-000000000001` and two existing tasks with `activityid` values of `00000000-0000-0000-0000-000000000002` and `00000000-0000-0000-0000-000000000003`.
190
190
191
191
> [!NOTE]
192
192
> This request is using the `Prefer: return=representation` header so it returns the values of the created record. More information: [Create with data returned](#create-with-data-returned)
By default, duplicate detection is suppressed when you are creating records using the Web API. You must include the `MSCRM.SuppressDuplicateDetection: false` header with your POST request to enable duplicate detection. Duplicate detection only applies when 1) the organization has enabled duplicate detection, 2) the entity is enabled for duplicate detection, and 3) there are active duplicate detection rules being applied. More information: [Detect duplicate data using code](../detect-duplicate-data-with-code.md)
256
+
By default, duplicate detection is suppressed when you're creating records using the Web API. You must include the `MSCRM.SuppressDuplicateDetection: false` header with your POST request to enable duplicate detection. Duplicate detection only applies when the following conditions are true:
257
257
258
-
See [Detect duplicate data using Web API](manage-duplicate-detection-create-update.md#bkmk_create) for more information on how to check for duplicate records during Create operation.
258
+
- The organization has enabled duplicate detection
259
+
- The entity is enabled for duplicate detection
260
+
- There are active duplicate detection rules being applied
261
+
262
+
More information:
263
+
264
+
-[Detect duplicate data using code](../detect-duplicate-data-with-code.md)
265
+
-[Detect duplicate data using Web API](manage-duplicate-detection-create-update.md#bkmk_create)
259
266
260
267
<aname="bkmk_initializefrom"></a>
261
268
@@ -267,10 +274,10 @@ Use the <xref:Microsoft.Dynamics.CRM.InitializeFrom?text=InitializeFrom Function
267
274
-[Customize table and column mappings](../customize-entity-attribute-mappings.md)
268
275
269
276
> [!NOTE]
270
-
> To determine whether two entities can be mapped, use this query:<br />
277
+
> To determine whether two entities can be mapped, use the following query:<br />
This is a two step process. The `InitializeFrom` function doesn't create the record, but it returns data you can use to create a new record with specified property values mapped from the original record. You will combine the response data returned in the `InitializeFrom` function with any changes you want to make and then `POST` the data to create the new record.
280
+
Creating a new record from another record is a two step process. The `InitializeFrom` function doesn't create the record, but it returns data you can use to create a new record with specified property values mapped from the original record. You must combine the response data returned in the `InitializeFrom` function with any changes you want to make and then `POST` the data to create the new record.
274
281
275
282
The following example shows how to create an account record using the values of an existing account record with `accountid` value equal to `00000000-0000-0000-0000-000000000001`.
276
283
@@ -279,7 +286,7 @@ The following example shows how to create an account record using the values of
279
286
**Request**
280
287
281
288
```http
282
-
GET [Organization URI]/api/data/v9.0/InitializeFrom(EntityMoniker=@p1,TargetEntityName=@p2,TargetFieldType=@p3)?@p1={'@odata.id':'accounts(00000000-0000-0000-0000-000000000001)'}&@p2='account'&@p3=Microsoft.Dynamics.CRM.TargetFieldType'ValidForCreate' HTTP/1.1
289
+
GET [Organization URI]/api/data/v9.0/InitializeFrom(EntityMoniker=@p1,TargetEntityName=@p2,TargetFieldType=@p3)?@p1={'@odata.id':'accounts(00000000-0000-0000-0000-000000000001)'}&@p2='account'&@p3=Microsoft.Dynamics.CRM.TargetFieldType'ValidForCreate'
283
290
If-None-Match: null
284
291
OData-Version: 4.0
285
292
OData-MaxVersion: 4.0
@@ -303,14 +310,14 @@ Accept: application/json
303
310
304
311
### Step 2: Create the new record
305
312
306
-
The response received from `InitializeFrom` function consists of values of mapped columns between the source table and target table and the GUID of the parent record. The column mapping between tables that have an relationship is different for different tables and is customizable, so the response from `InitializeFrom` function request may vary for different organizations.
313
+
The response received from `InitializeFrom` function consists of values of mapped columns between the source table and target table and the GUID of the parent record. The column mapping between tables that have a relationship is different for different tables and is customizable, so the response from `InitializeFrom` function request may vary for different organizations.
307
314
308
315
309
316
310
-
Other property values can also be set and/or modified for the new record by adding them in the JSON request body, as shown in the example below.
317
+
Other property values can also be set and/or modified for the new record by adding them in the JSON request body, as shown in the following example:
311
318
312
319
```http
313
-
POST [Organization URI]/api/data/v9.0/accounts HTTP/1.1
320
+
POST [Organization URI]/api/data/v9.0/accounts
314
321
Content-Type: application/json; charset=utf-8
315
322
OData-MaxVersion: 4.0
316
323
OData-Version: 4.0
@@ -333,7 +340,7 @@ Accept: application/json
333
340
334
341
## Create documents in storage partitions
335
342
336
-
If you are creating large numbers of records for elastic tables, you can create the entities in storage partitions to speed up access to those entity records.
343
+
If you're creating large numbers of records for elastic tables, you can create the entities in storage partitions to speed up access to those entity records.
337
344
338
345
More information: [Create a record in an elastic table](../use-elastic-tables.md#create-a-record-in-an-elastic-table)
0 commit comments