Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Unanswered

How to use Pagination in Custom Page API in Business central

Posted on by 61
Hi All,

I am using On-Prem Business Central.

I have created one Custom Page API to fetch Items from Business Central, but its taking to much long time to get all the 20,000 item.
I want to use pagination in this API to fetch 15 record for each API call, but i never use or heard about pagination in Page API.

Does anyone have any idea about it. How we can implement it or if you have any code snip you can share.

Page API code :   This is my API where i want to use Pagination.
 
page 50119 "GetAllItemsDetail"
{
    PageType = API;
    APIVersion = 'v1.0';
    APIPublisher = 'QueryV1';
    APIGroup = 'QueryGroup';
    EntityName = 'Item';
    EntitySetName = 'Items';
    DelayedInsert = true;
    SourceTable = Item;
    layout
    {
        area(content)
        {
            repeater(Group)
            {
                field(Id; Rec.SystemId)
                {
                    Caption = 'Id';
                }
                field(ItemNo; Rec."No.")
                {
                    Caption = 'Item No';
                }
                field(Name; Rec.Description)
                {
                    Caption = 'Description';
                }
                field(Base_Unit_Price; Rec."Unit Price")
                {
                    Caption = 'Base Unit Price';
                }
            }
        }
    }
}
 
Thanks for your Help.
Categories:
  • gdrenteria Profile Picture
    gdrenteria 9,676 Most Valuable Professional on at

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,556 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,625 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans