intacct / intacct-sdk-js

Official repository of the Sage Intacct SDK for JavaScript in Node.js
https://developer.intacct.com/tools/sdk-node-js/
Apache License 2.0
23 stars 33 forks source link

Long lists in QueryFilter 'value' cause an error #54

Closed yungtilly closed 2 years ago

yungtilly commented 3 years ago

Hello,

I am trying to create a query that pulls the RECORDID for every invoice whose RECORDNO value appears in a list that I include in a QueryFilter statement.

let invoice_query = new IA.Functions.Common.NewQuery.Query()
invoice_query.fromObject = 'ARINVOICE'

let querySelect = new IA.Functions.Common.NewQuery.QuerySelect.SelectBuilder()
querySelect.addFields(['RECORDNO', 'RECORDID'])
invoice_query.selectFields = querySelect.selects

invoice_query.pageSize = 2000

let queryFilter = new IA.Functions.Common.NewQuery.QueryFilter.Filter('RECORDNO').in(invoice_nos)
invoice_query.assignFilter(queryFilter)

The code that I included above works when the length of invoice_nos is less than a certain threshold (I haven't been able to confirm this, but the threshold appears to be 1000); however, once the list length exceeds that threshold, attempts to execute the query yield the following error:

"XL03000003 XML Parse schema error: Error 1871: Element 'value': This element is not expected.. Line: 1, column: 0. [Support ID: MhL0rEB033%7EX-Xq6P0w2ZI-R2%40WZhcqhQAAAAU]"

Am I diagnosing this error correctly in concluding that I'm exceeding a limit on the length of the list? If so, are there any workarounds that I should be aware of, and/or can I expect this behavior to change in the future?

Thanks in advance.

wwalraven commented 3 years ago

The Query function will not return more than 1000 items. To retrieve more, the function needs to be called repeatedly with a new offset. It appears the SDK does not handle this corectly.

karstenintacct commented 3 years ago

Hi there,

I wanted to follow up on this issue:

  1. Could you share the XML request that is being generated. The error message indicates that the XML request is invalid.
  2. Also you could try to send the request via postman or curl and see if you get the same response. Please let us know any details on this.
  3. Lastly, if you are still running into this issue, let's have a quick call to walk through this. Hopefully, we can resolve this issue quickly.

Just to confirm: Query is supporting actually 2000 as a max, different from readByQuery, which only supports 1000 record (https://developer.intacct.com/web-services/queries/)

Thank you and have a good weekend. Karsten