---
schema_version: "1"
id: 00a387f47bd2ed012b42c7569a4d41430f09d042da0e89babfbc43878e284d7d
title: CursorFetchResult Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_Database_CursorFetchResult.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Database_CursorFetchResult.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: bec1ec1fee3f5be3532a1563d3ec9948d4d9a28117b5d1d2807e4342a642cf1e
description: This class encapsulates the result of a PaginationCursor.fetchPage() call. It contains methods that get the rows for the current page, the start index of the next page, and the number of deleted rows skipped during the fetch operation. It also contains a method that indicates whether the pagination cursor has fetched all available rows in the result set.Gets the start index required to fetch the next page of results. Use this value as the start parameter in the call to PaginationCursor.fetchPage(start, pageSize) to fetch the next page of results. Gets the number of deleted rows that were skipped during the fetch operation.Gets the list of records that comprise the rows on the current page.Returns true if the pagination cursor has reached either the page size passed to PaginationCursor.fetchPage(start, pageSize) or the end of the result set. Otherwise returns false.
---
# CursorFetchResult Class

This class encapsulates the result of a PaginationCursor.fetchPage() call. It contains methods that get the rows for the current page, the start index of the next page, and the number of deleted rows skipped during the fetch operation. It also contains a method that indicates whether the pagination cursor has fetched all available rows in the result set.

## Namespace

[Database](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_Database.htm "The Database namespace provides classes used with DML operations.")

- **[CursorFetchResult Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Database_CursorFetchResult.htm#apex_Database_CursorFetchResult_methods)**

## CursorFetchResult Methods

The following are methods for CursorFetchResult.

- **[getNextIndex()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Database_CursorFetchResult.htm#apex_Database_CursorFetchResult_getNextIndex)**  
    Gets the start index required to fetch the next page of results. Use this value as the start parameter in the call to PaginationCursor.fetchPage(start, pageSize) to fetch the next page of results.
- **[getNumDeletedRecords()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Database_CursorFetchResult.htm#apex_Database_CursorFetchResult_getNumDeletedRecords)**  
    Gets the number of deleted rows that were skipped during the fetch operation.
- **[getRecords()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Database_CursorFetchResult.htm#apex_Database_CursorFetchResult_getRecords)**  
    Gets the list of records that comprise the rows on the current page.
- **[isDone()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Database_CursorFetchResult.htm#apex_Database_CursorFetchResult_isDone)**  
    Returns true if the pagination cursor has reached either the page size passed to PaginationCursor.fetchPage(start, pageSize) or the end of the result set. Otherwise returns false.

### getNextIndex()

Gets the start index required to fetch the next page of results. Use this value as the start parameter in the call to PaginationCursor.fetchPage(start, pageSize) to fetch the next page of results.

#### Signature

public Integer getNextIndex()

#### Return Value

Type: [Integer](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_integer.htm#apex_methods_system_integer "Contains methods for the Integer primitive data type.")

### getNumDeletedRecords()

Gets the number of deleted rows that were skipped during the fetch operation.

#### Signature

public Integer getNumDeletedRecords()

#### Return Value

Type: [Integer](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_integer.htm#apex_methods_system_integer "Contains methods for the Integer primitive data type.")

### getRecords()

Gets the list of records that comprise the rows on the current page.

#### Signature

public List<SObject> getRecords()

#### Return Value

Type: [List](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_list.htm#apex_methods_system_list "Contains methods for the List collection type.")<[sObject](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_sobject.htm#apex_methods_system_sobject "Contains methods for the sObject data type.")\>

The list of sObjects from the SOQL query for the current page.

### isDone()

Returns true if the pagination cursor has reached either the page size passed to PaginationCursor.fetchPage(start, pageSize) or the end of the result set. Otherwise returns false.

#### Signature

public Boolean isDone()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

#### See Also

- [getPaginationCursor(query, accessLevel)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_database.htm#apex_System_database_getPaginationCursor "Creates a pagination cursor when the specified SOQL query is executed.")
- [PaginationCursor Class](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Database_PaginationCursor.htm#apex_class_Database_PaginationCursor "This class represents a pagination cursor that can traverse a SOQL query result set. It contains methods that fetch rows by page. It also contains a method that returns the total number of rows in the result set.")
- [_Apex Developer Guide_: Apex Cursors](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexcode.meta/apexcode/apex_cursors.htm "Apex Developer Guide: Apex Cursors - HTML (New Window)")