---
schema_version: "1"
id: e262dd22989d4d5c1a93db94f1e5e22a05e6593f0acb908697c6b29ce3591d16
title: |-
  Support queryMore by Using Server-Driven Paging by Using
      Server-Driven Paging
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexcode/apex_connector_querymore_server_driven_paging.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connector_querymore_server_driven_paging.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0b922d887cf668c767c8d7e3e286e51cf506dc7b07a4c9010a5a131ee4968bd1
description: 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 Server-Driven Paging by Using Server-Driven Paging

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.

When the returned DataSource.TableResult doesn’t contain the entire result set, the TableResult must provide a queryMoreToken value. The query token is an arbitrary string that we store temporarily. When we request the next batch of results, we pass the query token back to your custom adapter in the DataSource.QueryContext. Your Apex code must use that query token to determine which rows belong to the next batch of results.

When your custom adapter returns the final batch, it must not return a queryMoreToken value in the TableResult.

The Apex Connector Framework doesn't support server-driven pagination for list views.

#### See Also

- [queryMore with the Apex Connector Framework](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connector_querymore.htm "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.")