Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieving only 2000 custom fields #30

Open
desaikarna opened this issue Feb 13, 2015 · 2 comments
Open

Retrieving only 2000 custom fields #30

desaikarna opened this issue Feb 13, 2015 · 2 comments

Comments

@desaikarna
Copy link

Hi Andrew,

I am using your sample code for retrieving Custom fields and Custom Objects, the issue I am facing is that in our org we have around 3k custom fields,

when I try to do the same with your class ToolingApi I only get 2000 custom fields. Sample code below
ToolingAPI toolingAPI = new ToolingAPI();
List<ToolingAPI.CustomField> customFields = (List<ToolingAPI.CustomField>)
toolingAPI.query('Select Id, DeveloperName, NamespacePrefix, TableEnumOrId From CustomField ').records;
System.debug(customFields.size());

Any ideas why I am getting only 2k fields ?

Update: I figured it out , would have to retrieve records using "nextRecordsURL" .

@afawcett
Copy link
Owner

Ok thanks for letting us know, i'll mark this as an enhancement.

@mattandneil
Copy link

SOAP equivalent like so:

QueryResult result = client.query(strQuery);
List<CustomField> customFields = result.records;
while (!result.done) customFields.addAll((result = client.queryMore(result.queryLocator)).records);

(The queryMore method is already there, it just need to be used by the calling code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants