Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Unanswered

Bypass total number of records retrieve using custom BC API

Posted on by 20
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? 
Categories:
  • ND-30081126-0 Profile Picture
    ND-30081126-0 20 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
    EGMX 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans