Difference between revisions of "OdataLink Error Code 9008: Xero imposed a limit of 100,000 records per request"

no edit summary
Line 1: Line 1:
'''Error 9008''' will be logged when [[Xero]] imposes the limit of 100,000 records per request. This is also known as the High Volume Threshold limit.
'''Error 9008''' will be logged when [[Xero]] imposes the limit of 100,000 records per request.  


Note that Xero can raise this error even if the number of records that it would return is considerably lower. This is due to how builds it's pages of data. It uses specialised indexes that look at a subset of your data. While the actual records that gets returned could be lower, the error is triggered when the indexes have more than 100,000 records.


You can work through this issue by configuring using the [[Archive Paging]] option of the model and setting it either to '''By Month''' or '''By Year'''. Doing so ensures that OdataLink asks for small amounts of data. In other words, it asks for a single month or a single years worth of data. This instructs Xero to look at a different kind of index and should allow you to retrieve all the data you need.
== Why am I receiving this error ==
 
To ensure the best performance on Xero's API servers, they prevent certain requests from consuming too much resources. This is known as the High Volume Threshold limit.
 
It's important to understand that Xero can raise this error even if the number of records that it would return is considerably lower. This is due to how builds it's pages of data. It uses specialised indexes to quickly determine the data you need. While the actual records that gets returned could be lower, the error is triggered when these indexes have more than 100,000 records.
 
 
== Apply additional filters to your power queries ==
 
One way you can prevent this error from occurring is by applying additional filters to your queries. Typically, the '''Date''', '''Type''' and '''Status''' fields of their endpoint are associated with additional optimised indexes. By filtering by these fields, Xero can look at smaller indexes to provide your data.
 
 
== Configure the model Archive Paging setting to prevent this error ==
 
Another way to prevent this error is by controlling the date range of the data you request.
 
OdataLink provides an [[Archive Paging]] setting. This [[Models|model]] setting can  either be set to '''By Month''' or '''By Year'''. Doing so ensures that OdataLink asks for small amounts of data. In other words, it asks for a single month or a single years worth of data at a time. It chains multiple calls together to provide the complete data set. By paging in this way, this instructs Xero to look at a different kind of index and should allow you to retrieve all the data you need.


See [[Editing a model's details]] for instructions on how to configure your model.
See [[Editing a model's details]] for instructions on how to configure your model.
3,244

edits