问题描述:

I am trying to execute a query to fetch full record of user roles from salesforce using SOAP.

But I am getting only 2000 records out of 17,000.

I want to display all roles and its corresponding level as shown below.

RoleID ParentID Level Has subordinate?

1111 2222 1 yes

As i am getting a portion of data , I am not able to iterate and calculate the actual Level.

Please help me on this or suggest me a better method.

Thanks,

网友答案:

API returns the results in chunks / batches. You're supposed to call queryMore() function to fetch next "page" of results.

There are LOADS of questions about it already, including some language-specicic answers (if you're using the libraries for Ruby for example). And there are even better ones at salesforce.stackexchange.com:

  1. http://salesforce.stackexchange.com/questions/35011/get-more-than-2000-with-soap-and-php
  2. Check http://salesforce.stackexchange.com/questions/924/is-there-a-way-to-query-role-hierarchy too
  3. And if you have thousands of records (and if your app can handle bigger chunks!) maybe you should read about bulk API.
相关阅读:
Top