0

I can't find anything on how quickbooks orders results when querying with qbXML. It seems like at the very least it would be mentioned in this section:

https://developer.intuit.com/app/developer/qbdesktop/docs/develop/exploring-the-quickbooks-desktop-sdk/query-requests-and-responses#using-maxreturned-to-specifying-the-maximum-number-of-objects-returned

For example, in that section it says:

"To continue looking at objects that match the query’s criteria ... if you are dealing with an alphabetized list of customer names, use NameRangeFilter:FromName"

Is this saying that by virtue of using the NameRangeFilter, the results are guaranteed to be ordered by FromName? If I use a ModifiedDateRangeFilter, does that assure that the results are ordered by modified date?

I'm trying to figure out how to know where to pick up from the last time a connector transaction ran, but without knowing how results are ordered it seems like I can't confidently know.

Todd W
  • 11
  • 1

1 Answers1

1

There is no way to specify the order of a qbXML result.

If you're trying to fetch a large # of results, use iterators - the purpose of an iterator is specifically so that you can walk through a large result set, and not have to keep track of where you left off -- the iterator does that for you.

Keith Palmer Jr.
  • 27,666
  • 16
  • 68
  • 105
  • Thanks! What I'm going for is the initial sync. The QB user has 4k customers and 50k invoices. This is a strain on the initial sync and is locking up the connector. I want to tell the connector "ok, you've sent 100 records via this iterator, lets stop now and we'll send the next 100 in 15 minutes the next time you connect." This is where knowing the ordering comes in. I agree that once the external service and QB are "up to date" that the ordering will no longer matter. – Todd W Mar 14 '19 at 13:10
  • If you use iterators, you specifically don't need to (and _can't_) do that. If you're running into performance problems then what you can do is slow down your response processing (e.g. add in some `sleep()` statements so QuickBooks gets a break _and_ use a smaller result chunk (e.g. 25 records at a time). Iterators guarantee that you'll get all the records - you _don't_ have to specify an order, because they keep track of that for you automatically. – Keith Palmer Jr. Mar 14 '19 at 14:42