I have an object with 50000 records in it, which I need to retrieve in chunks of 100 records per call/chunk.

I tried using OFFSET, but this way you can not call more than 2000 records.

Is there an example of how to use javascript remoting to do this? or maybe a different approach?

share|improve this question
sharing your code would help us understand your requirement better. It will help us know why exactly you can't use OFFSET. – user576 Sep 17 '12 at 10:42

2 Answers

There is an alternative which is kind of nasty but one way of managing OFFSET Limits.

1) create a autonumber field in the object you use and convert the string to a number and tada you have auto numbers as unique record identifiers for every records(there can be no duplicate, which ensures every record gets a unique number/offset) Downside of this is that its a sequential number and if one of the records get deleted and say you use select id from account order by offset__C asc

there are chances that the list may return only 2800 where 200 records were deleted

share|improve this answer

Im afraid I dont think its possible to get the 50,000 rows via remoting. Checking https://login.salesforce.com/help/doc/en/salesforce_app_limits_cheatsheet.pdf (page 39 & 40) shows the maximum OFFSET you can use is 2000 and the maximum rows per query is 200.

I have seen other similar questions and the recommended course of action is to export the data from salesforce with the Data Loader (Setup -> Admin -> Data Management -> Data Loader). I havent tried this myself and i'm unsure of what your trying to achieve but hopefully this helps. https://eu1.salesforce.com/dwnld/DataLoader/ApexDataLoader.exe

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.