PagedData.fetch(options)

Note:

The content in this help topic pertains to SuiteScript 2.0.

Method Description

Retrieves a page in the set of pages included in the PagedData object.

Returns

query.Page

Supported Script Types

Client and server scripts

For more information, see SuiteScript 2.x Script Types.

Governance

None

Module

N/query Module

Parent Object

query.PagedData

Sibling Object Members

PagedData Object Members

Since

2018.1

Parameters

Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

options.index

number

required

The index of the page to retrieve.

Page indexes start at 0.

Errors

Error Code

Thrown If

INVALID_PAGE_INDEX

The value of the options.index parameter is not a number.

INVALID_PAGE_RANGE

The value of the options.index parameter is a negative number or is greater than or equal to the number of pages in the PagedData object.

Syntax

Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/query Module Script Samples.

            // Add additional code
...
var myCustomerQuery = query.create({ type: query.Type.CUSTOMER
}); myCustomerQuery.columns = [ myCustomerQuery.createColumn({ fieldId: 'entityid' }), myCustomerQuery.createColumn({ fieldId: 'firstname' }), myCustomerQuery.createColumn({ fieldId: 'email' })
]; var myPagedResults = myCustomerQuery.runPaged({ pageSize: 10
}); for (var i = 0; i < myPagedResults.pageRanges.length; i++) { var currentPage = myPagedResults.fetch(i); var currentPagedData = currentPage.pagedData; log.debug(currentPage.pageRange.size);
}
...
// Add additional code 

          

Related Topics

query.Query
N/query Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices