web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / Pagination with Odata
Finance forum

Pagination with Odata

(0) ShareShare
ReportReport
Posted on by

Hi,

I want to know how we can handle pagination with Odata calls. I believe by default it returns 1000 or 10,000 rows by default. If i want to retrieve only first 20 records in the first call and then user click next, then it should get next 20 records.

Thanks

Categories:
I have the same question (0)
  • Blue Wang Profile Picture
    on at
    RE: Pagination with Odata

    Hi JeffGreenrc,

    Has your problem been solved?

    If the above reply is helpful, please mark it as verified and make it easy for others to find a solution quickly.

    Thanks.

  • Blue Wang Profile Picture
    on at
    RE: Pagination with Odata

    Hi JeffGreenrc,

    You can use such a statement to query records while reading from D365F&O:

    DataServiceQuery EntityObject = context.[EntityName].AddQueryOption("$skip", 20).AddQueryOption("$top", 20);

  • Suggested answer
    Pedro Tornich Profile Picture
    955 on at
    RE: Pagination with Odata

    Hi JeffGreenrc,

    OData has a maximum page size indeed and it's 1k records.

    To retrieve a page smaller than that you can use the $skip and $top filters.

    For example, to retrieve only the first 20 customers you can use the following URL:

    aos.sandbox.ax.dynamics.com/.../Customers

    Than, for the next page, you would need to skip the first 20:

    aos.sandbox.ax.dynamics.com/.../Customers

    And you keep increasing the skipped number each time the user goes to the next page:

    aos.sandbox.ax.dynamics.com/.../Customers

    You can find more information in the following link:

    docs.microsoft.com/.../odata

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans