You need to sign in to do that
Don't have an account?

How to query more than 100 records when using <apex:remoteObjectModel>
Dear SF experts,
I am currently trying to implement Remote Objects in Javascript to retrieve Accounts but having difficulty finding a workaround to query for more than the maximum limit of 100 records. Salesforce states that the maximum limit to return one batch of results is 100 but there is more than 2000 records that I need to query.
Would I have to use offsets and batch query 100 records at a time?
Here is some sample code that I was working with:
Any advice would be appreciated!
Thanks.
I am currently trying to implement Remote Objects in Javascript to retrieve Accounts but having difficulty finding a workaround to query for more than the maximum limit of 100 records. Salesforce states that the maximum limit to return one batch of results is 100 but there is more than 2000 records that I need to query.
Would I have to use offsets and batch query 100 records at a time?
Here is some sample code that I was working with:
j$(document).ready(function() { var acctTable = j$('[id$="accounttable"]').DataTable({ "ajax": function(data, callback, settings) { var acct = new SObjectModel.Account(); acct.retrieve({ orderby: [{ Name: 'ASC' }], limit: 1000 }, function(err, records) { if (err) alert(err.message); else { callback({ 'data': records }); }; }); },
Any advice would be appreciated!
Thanks.
As per the documentation:
Use limit to specify how many records to return in one batch of results. The default value is 20. The maximum is 100.
You can refer to:
http://www.salesforce.com/docs/developer/pages/Content/pages_remote_objects_using_retrieve_query_object.htm
Thanks,
Pratik
Thanks for your comment. I was actually wondering how I can query for more than the maximum of 100 records...
Thanks,
Controller
Thank you
Sai