Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

Bypass total number of records retrieve using custom BC API

(0) ShareShare
ReportReport
Posted on by 22
Hi all,

I have created below query to retrieve item attribute values. In the query API, I get the items and the values that are connected to them. 
 
query 60116 /itemAttributeValue/
{
 
    QueryType = API;
    APIPublisher = 'ND';
    APIGroup = 'apigroup';
    APIVersion = 'v1.1';
    Caption = 'itemAttributeValue';
    EntityName = 'itemAttributeValue';
    EntitySetName = 'itemAttributeValue';
    elements
    {
        dataitem(Item; Item)
        {
            column(No_; /No./)
            {
            }
            column(Description; Description)
            {
            }
 
            dataitem(Item_Attribute_Value_Mapping; /Item Attribute Value Mapping/)
            {
                DataItemLink = /No./ = Item./No./;
 
                column(Item_Attribute_ID; /Item Attribute ID/)
                {
                }
                column(Item_Attribute_Value_ID; /Item Attribute Value ID/)
                {
                }
                dataitem(QueryElement6; /Item Attribute/)
                {
                    DataItemLink = ID = Item_Attribute_Value_Mapping./Item Attribute ID/;
                    column(Name; Name)
                    {
                    }
                    dataItem(Queryelement10; /Item Attribute Value/)
                    {
                        DataItemLink = /Attribute ID/ = Item_Attribute_Value_Mapping./Item Attribute ID/,
                        ID = Item_Attribute_Value_Mapping./Item Attribute Value ID/;
                        column(Value; Value)
                        {
                        }
                        column(Numeric_Value; /Numeric Value/)
                        {
                        }
                    }
                }
            }
 
        }
    }
}
 
However, we use item attribute values a lot in the company and this table has a total of 100.000+ records. This seems to be a problem when using API in Business Central. 
Has anyone a solution to bypass the record limits of 20.000 when using a API get request? 
  • ND-30081126-0 Profile Picture
    22 on at
    Bypass total number of records retrieve using custom BC API
    Hi Edgar,

    I have seen some description about pagination. That should be the best shot, since MS will in make OData obsolete in the near future. 
    With OData, you are able to get more than 20.000 records. 
  • EGMX Profile Picture
    29 on at
    Bypass total number of records retrieve using custom BC API
    Hi Nick!
     
    I think the Microsoft OData connector should allow for over 20,000 rows to be downloaded as of earlier this year, at least for Excel and PowerBI, but I might be getting that wrong.
     
    If not, it might be possible to create a script that paginates through the data for you. Have it check if the response you get to your query has a "@odata.nextLink" field and if so, request it again and append the result, repeat until there's no more records.
     
    Hope this is of some help!
    - Edgar.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,424 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,043 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans