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/clientapi/reference/Xrm-WebApi/retrieveMultipleRecords.md
+74-3Lines changed: 74 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ search.app:
63
63
<td>successCallback</td>
64
64
<td>Function</td>
65
65
<td>No</td>
66
-
<td><p>A function to call when entity records are retrived. An object with the following attributes is passed to the function:</p>
66
+
<td><p>A function to call when entity records are retrieved. An object with the following attributes is passed to the function:</p>
67
67
<ul>
68
68
<li><b>entities</b>: An array of JSON objects, where each object represents the retrieved entity record containing attributes and their values as <code>key: value</code> pairs. The Id of the entity record is retrieved by default.</li>
69
69
<li><b>nextLink</b>: String. If the number of records being retrieved is more than the value specified in the <code>maxPageSize</code> parameter in the request, this attribute returns the URL to return next set of records.</li>
This example queries the accounts entity set and uses the `$select` and `$filter` system query options to return the name and primarycontactid property for accounts that have a particular primary contact when working in the offline mode:
@@ -218,6 +218,7 @@ Next page link: [Organization URI]/api/data/v9.0/accounts?$select=name&$skiptoke
218
218
> The value of the `nextLink` property is URI encoded. If you URI encode the value before you send it, the XML cookie information in the URL will cause an error.
219
219
220
220
### Retrieve related entities by expanding navigation properties
221
+
#### For online scenario (connected to server)
221
222
222
223
Use the **$expand** system query option in the navigation properties to control the data that is returned from related entities. The following example demonstrates how to retrieve the contact for all the account records. For the related contact records, we are only retrieving the `contactid` and `fullname`:
**$expand** for the mobile offline scenario is different from the online scenario and is a multi-part process. An offline **\$expand** operation returns a `@odata.nextLink` annotation containing information on how to get to the related record's information. We use the `id`, `entityType`, and `options` parameter of that annotation to construct one or more additional `Xrm.WebApi.offline.retrieveRecord` request(s). The following piece of code provides a complete example of how to do this:
// perform additional operations on retrieved records
305
+
}, function(error) {
306
+
console.error(error);
307
+
// handle error conditions
308
+
});
309
+
```
239
310
240
311
For more examples of retrieving multiple records using Web API, see [Query Data using the Web API](../../../../common-data-service/webapi/query-data-web-api.md).
0 commit comments