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.
{
PageType = API;
APIVersion = 'v1.0';
APIPublisher = 'QueryV1';
APIGroup = 'QueryGroup';
EntityName = 'Item';
EntitySetName = 'Items';
DelayedInsert = true;
SourceTable = Item;
{
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';
}
}
}
}
}