java - findAll method of DataService class returns only 100 entities -


we've migrated our v2 qbo v3 , after on production got issue 1 of our customers. have on 100 customers in qbo account. , want copy them our application. implemented import this:

    dataservice service = getdataservice(owner);  // obtain dataservice via access keys     list<com.intuit.ipp.data.customer> customers =           service.findall(new com.intuit.ipp.data.customer());      (com.intuit.ipp.data.customer customer : customers) {         createcustomer(customer, owner);  // our internal method create     } 

as mentioned in class library reference - method findall a

    method retrieve records given entity. 

but our customer getting only first 100 entities (customer's) qbo v3 account. , if same import operation - same first 100 entities again. method doesn't allow pagination options.

so question is, how all of entities?

you should use query endpoint page filters.

the following query gets customers 1 - 10:

string query = select($(customer)).skip(0).take(10).generate(); 

output - select * customer startposition 1 maxresults 10

the following query gets customers 21 - 25:

string query = select($(customer)).skip(20).take(10).generate(); 

ref - https://developer.intuit.com/docs/0025_quickbooksapi/0055_devkits/0201_ipp_java_devkit_3.0/0011_query_filters#pagination

finally

queryresult queryresult = service.executequery(query); 

thanks


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -