Reputation: 13
Using IPP Java DevKit 2.0.9 (also tried with 2.0.6), I've implemented a wrapper method for finding specific invoices in QBO by customer ID and occurring before a certain date. I'm testing with a particular customer who has 65 invoices across ~16 months, but the query always returns the 10 "latest" invoices occurring before dateFinish (endTransactionDate). I've tried various permutations as well: only including the customer ID criteria, only including the endTransactionDate, adding a "really early" startTransactionDate, development version, and production version. It's as if the API is chopping off the results list and only including the first 10 records, seemingly without a good reason.
public static List<QBInvoice> findInvoices(PlatformSessionContext context, String dataSource, Calendar dateFinish, List<String> customerIds) throws QBInvalidContextException, Exception {
QBInvoiceService invoiceService = QBServiceFactory.getService(context, QBInvoiceService.class);
QBInvoiceQuery invoiceQuery = new QBInvoiceQuery(context);
invoiceQuery.setEndTransactionDate(QuickbooksUtil.dateToQbDate(dateFinish));
if (!customerIds.isEmpty()) {
IdSet idSet = QuickbooksUtil.stringListToIdSet(context, dataSource, customerIds);
invoiceQuery.setContactIdSet(idSet);
}
return invoiceService.getInvoices(context, invoiceQuery);
}
Upvotes: 1
Views: 128
Reputation: 1484
Specify the PageNum and ResultsPerPage in your request. You are being returned the default, which is Page=1 and ResultsPerPage=10.
Upvotes: 3