function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

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:
j$(document).ready(function() {
            var acctTable = j$('[id$="accounttable"]').DataTable({
                "ajax": function(data, callback, settings) {
                    var acct = new SObjectModel.Account();
                        orderby: [{
                            Name: 'ASC'
                        limit: 1000
                    }, function(err, records) {
                        if (err) alert(err.message);
                        else {
                                'data': records

Any advice would be appreciated!
PratikPratik (Salesforce Developers) 
Hi Chyun,

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:

Hey Pratik,
Thanks for your comment. I was actually wondering how I can query for more than the maximum of 100 records... 

Sai Ram ASai Ram A
Just a quick thought wanted to share, though this may Help:)
<apex:page Controller="listCont" readOnly="true">
        <apex:includescript value="//" / >
        <apex:includescript value="//" />
        <apex:stylesheet value="//" />
            j$ = jQuery.noConflict();
            j$(document).ready( function () {
                var contactTable = j$('[id$="contacttable"]').DataTable({
                    order: [[2, 'asc']],
                    initComplete: function() {
                        var api = this.api();
                        var select = j$('[id$=accountSelect]');
                        api.column(0).data().unique().sort().each( function ( d, j ) {
                            select.append( '<option value="'+d+'">'+d+'</option>' )
                        } );   

                j$('[id$=accountSelect]').change(function() {
                    var val = j$.fn.dataTable.util.escapeRegex(
                        .search( val == 'All' ? '' : '^'+val+'$', true, false )
        <table id="contacttable" class="display">
                    <th>Account Name</th>
                <apex:repeat value="{!accountList}" var="accounts">

public class listCont{

public List<Account> accountList {
        get {
            if (accountList == null) {
                accountList = [SELECT Name, Fax, Phone FROM Account limit 10000];
            return accountList;


Thank you

Did you ever find a solution for this?