---
schema_version: "1"
id: ea18f42ef4be28b4436a19e7f4f1eaaf8fc8683dd3276df122acb555364fb513
title: |-
  queryMore with the Apex
      Connector Framework
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexcode/apex_connector_querymore.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connector_querymore.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: d21c51b802998cb4ddfdd303f7c5991af0127df759e3e02dd793815184627aa1
description: Custom adapters for Salesforce Connect don’t automatically support the queryMore method in API queries. However, your implementation must be able to break up large result sets into batches and iterate over them by using the queryMore method in the SOAP API. The default batch size is 500 records, but the query developer can adjust that value programmatically in the query call.
---
# queryMore with the Apex Connector Framework

Custom adapters for Salesforce Connect don’t automatically support the queryMore method in API queries. However, your implementation must be able to break up large result sets into batches and iterate over them by using the queryMore method in the SOAP API. The default batch size is 500 records, but the query developer can adjust that value programmatically in the query call.

To support queryMore, your implementation must indicate whether more data exists than what’s in the current batch. When the Lightning Platform knows that more data exists, your API queries return a QueryResult object that’s similar to the following.

{
         "totalSize" => -1,
              "done" => false,
    "nextRecordsUrl" => "/services/data/v32.0/query/01gxx000000B5OgAAK-2000",
           "records" => \[
        \[   0\] {
            "attributes" => {
                "type" => "Sample\_\_x",
                 "url" => 
                     "/services/data/v32.0/sobjects/Sample\_\_x/x06xx0000000001AAA"
            },
            "ExternalId" => "id0"
        },
        \[   1\] {
            "attributes" => {
                "type" => "Sample\_\_x",
                 "url" => 
                     "/services/data/v32.0/sobjects/Sample\_\_x/x06xx0000000002AAA"
            },
…
}

- **[Support queryMore by Using Server-Driven Paging by Using Server-Driven Paging](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connector_querymore_server_driven_paging.htm)**  
    With server-driven paging, the external system controls the paging and ignores any batch boundaries or page sizes that are specified in queries. To enable server-driven paging, declare the QUERY\_PAGINATION\_SERVER\_DRIVEN capability in your DataSource.Provider class.
- **[Support queryMore by Using Client-Driven Paging](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connector_querymore_client_driven_paging.htm)**  
    With client-driven paging, you use LIMIT and OFFSET clauses to page through result sets.