derekfinlinson / xrm-webapi

Dynamics 365 Web Api TypeScript module
MIT License
27 stars 13 forks source link

Paging not Implemented for retrieveMultiple #17

Closed tim-hutch closed 7 years ago

tim-hutch commented 7 years ago

In the xrm-webapi/src/xrm-webapi.ts file, there is a function called getNextPage() which says it implements paging for retrieveMultiple. However, when I look at retrieveMultiple, there is no reference to getNextPage() and paging doesn't seem to be implemented in a different way.

derekfinlinson commented 7 years ago

I didn't want to force the user to retrieve all pages in case they only want the first page. You can call that method after each successful retrieveMultiple if you want to get the next page:

const api = new WebApi("8.2");

const accounts = await api.retrieveMultiple("accounts", "$select=accountid");

// Get odata.nextlink from retrieveMultiple
const next = accounts["@odata.nextlink"];

const nextAccounts = await api.getNextPage(next);
tim-hutch commented 7 years ago

I understand. It might be good to include that in your documentation. I'm guessing some other people will assume as I did that retrieveMultiple will return everything regardless of size.