开发者

SOQL Query to fetch more than 2000 records

How to fetch more than开发者_如何学JAVA 2000 records through SOQL .... Is there something query more ?


call queryMore with the queryLocator provided in the first set of results, keep calling it with the next queryLocator until the done flag is true. See the Web Services API docs for more info.


You can actually do this manually as well if you order by id and then query again with "where id > : idPrevious". If you try this just as I've typed it you'll hit a problem however, you can't use > and < with id fields. There is a simple work around for this though, just create a text type formula field which takes it's value from the id field. Then you can use that field in the query with no problems.

Of course if you're just looking to process loads of data then you might really be looking for Batch Apex.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜