findAll method of DataService class returns only 100 entities

前端 未结 2 1378
自闭症患者
自闭症患者 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条回答
  •  萌比男神i
    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 entities = queryResult.getEntities();
            for (IEntity entity : entities) {
                if (entity instanceof com.intuit.ipp.data.Customer) {
                    createCustomer((com.intuit.ipp.data.Customer) entity, owner);
                }
            }
    

提交回复
热议问题