Tell me more ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

The documentation says that bulk queries' results are limited in size. http://www.salesforce.com/us/developer/docs/api_asynch/Content/asynch_api_concepts_limits.htm

However I can't find any explanation on what happens when this limitation is reached. I suppose the result is simply truncated. Is there a way to be notified when we don't receive all the records matching the query?

The only solution I see is to perform two queries. One with only the Id field and the real query, then compare the number of records returned. This would take quite a long time and consume API calls.

I only want to be informed automatically that I have to split the query.

Thank you

share|improve this question
don't you get the results in a paged/bulk format? – Saariko Mar 25 at 11:32
Bulk queries return csv or xml files, and there is a limitation of 10 files of 1 gigabyte each. There is no information regarding how to know if the whole result fitted in the files or if it was truncated. – nicolas42 Apr 9 at 14:07

1 Answer

I suggest you look at how you might be able to use limit class methods to accomplish what you desire.

Several calls that come to mind are: getQueryLocatorRows (Returns the number of records that have been returned by the Database.getQueryLocator method), getQueryRows(Returns the number of records that have been returned by issuing SOQL queries) and getLimitQueryRows(Returns the total number of records that can be returned by issuing SOQL queries).

I'd think that doing a comparison between getLimitQueryRows and getQueryRows (the actual number of lines returned) would tell you what you need to know. How to integrate them into your existing code is of course an entirely different issue. ;)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.