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/model-driven-apps/best-practices/business-logic/do-not-use-odata-v2-endpoint.md
+50-21Lines changed: 50 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -102,12 +102,16 @@ The following table connects related areas for the Organization Data Service and
102
102
103
103
This section highlights the differences between using the Organization Data Service and the Web API.
104
104
105
+
The Organization Data Service is only able to perform Create, Retrieve, Update, and Delete operations on tables. These examples show the differences between the services to help migrate to the Web API.
106
+
105
107
### Query records
106
108
107
109
These examples show the differences between the Organization Data Service and the Web API when querying records.
108
110
109
111
#### [Organization Data Service](#tab/odatav2)
110
112
113
+
The Organization Data Service has no way to manage paging other than using `$top `and `$skip`, but the maximum page size was limited to 50 records.
When more than 50 records were returned, there is a `__next` property to access the next page:
205
+
206
+
```json
207
+
"__next": "https://[Organization URI]/XRMServices/2011/OrganizationData.svc/AccountSet?$select=OwnershipCode,PrimaryContactId,OpenDeals_Date,Telephone1,NumberOfEmployees,Name,AccountNumber,DoNotPhone,IndustryCode&$filter=PrimaryContactId/Id ne null&$skiptoken=1,'accountid','%7B22153355-851D-ED11-B83E-000D3A572421%7D','%7B7A4814F9-B0B8-EA11-A812-000D3A122B89%7D'"
208
+
```
209
+
200
210
#### [Web API](#tab/webapi)
201
211
212
+
With Web API you have explicit control over paging using the `Prefer: odata.maxpagesize` request header.
<All properties are returned. Removed for brevity>
347
+
331
348
}
332
349
}
333
350
334
351
```
335
352
336
353
#### [Web API](#tab/webapi)
337
354
338
-
The Web API example in this case uses the `Prefer: return=representation` request header which defines a behavior similar to the Organization Data Service behavior of returning `201 Created` with the columns defined by the `$select` query option. Without this request header, Web API returns `201 No Content`.
355
+
The Web API example in this case uses the `Prefer: return=representation` request header which defines a behavior similar to the Organization Data Service behavior of returning `201 Created` with the columns defined by the `$select` query option. Without this request header, Web API returns `201 No Content` and the id of the record created is included in the url value of the `OData-EntityId` reponse header.
@@ -410,7 +438,7 @@ These examples show the differences between the Organization Data Service and th
410
438
**Request**
411
439
412
440
```http
413
-
GET https://crmue.api.crm.dynamics.com/XRMServices/2011/OrganizationData.svc/AccountSet(guid'b68d56a6-4739-ed11-9db0-002248296d7e')?$select=OwnershipCode,PrimaryContactId,OpenDeals_Date,Telephone1,NumberOfEmployees,Name,AccountNumber,DoNotPhone,IndustryCode HTTP/1.1
441
+
GET https://[Organization URI]/XRMServices/2011/OrganizationData.svc/AccountSet(guid'b68d56a6-4739-ed11-9db0-002248296d7e')?$select=OwnershipCode,PrimaryContactId,OpenDeals_Date,Telephone1,NumberOfEmployees,Name,AccountNumber,DoNotPhone,IndustryCode HTTP/1.1
GET https://crmue.api.crm.dynamics.com/api/data/v9.2/accounts(b68d56a6-4739-ed11-9db0-002248296d7e)?$select=ownershipcode,_primarycontactid_value,opendeals_date,customersizecode,telephone1,numberofemployees,name,accountnumber,donotphone,industrycode HTTP/1.1
493
+
GET https://[Organization URI]/api/data/v9.2/accounts(b68d56a6-4739-ed11-9db0-002248296d7e)?$select=ownershipcode,_primarycontactid_value,opendeals_date,customersizecode,telephone1,numberofemployees,name,accountnumber,donotphone,industrycode HTTP/1.1
0 commit comments