findAll method of DataService class returns only 100 entities

前端 未结 2 1350
自闭症患者
自闭症患者 2021-01-28 14:11

We\'ve successfully migrated our v2 QBO to v3 and after that on the production we got an issue from one of our customers. They have over 100 their customers in QBO account. And

相关标签:
2条回答
  • 2021-01-28 14:59

    You should use Query endpoint with page filters.

    The following query gets customers 1 - 10:

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

    Output - SELECT * FROM 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

    0 讨论(0)
  • 2021-01-28 15:00

    To fetch all of customers for a specified business, first you need to get their count, and then, as mentioned at the previous answer, get the customers by "take" method:

            Integer customersTotal = service.executeQuery(selectCount(_customer).generate()).getTotalCount();
            QueryResult queryResult = service.executeQuery(select($(_customer)).skip(0).take(customersTotal).generate());
            List<? extends IEntity> entities = queryResult.getEntities();
            for (IEntity entity : entities) {
                if (entity instanceof com.intuit.ipp.data.Customer) {
                    createCustomer((com.intuit.ipp.data.Customer) entity, owner);
                }
            }
    
    0 讨论(0)
提交回复
热议问题