PagedData.fetch(options)

Note:

The content in this help topic pertains to SuiteScript 2.0.

Method Description

This method retrieves the data within the specified page range.

This method also includes a promise version, PagedData.fetch.promise(). For more information about promises, see Promise Object.

Returns

search.Page

Supported Script Types

Client and server scripts

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

Governance

5 units

Module

N/search Module

Since

2016.1

Parameters
Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

pageRange.index

number

required

The index of the page range that bounds the desired data.

Page range indexes start at 0.

Errors

Error Code

Message

Thrown If

INVALID_PAGE_RANGE

Invalid page range.

The page range is not valid.

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/search Module Script Samples.

          // Add additional code
...
var mySearch = search.create({
    type: search.Type.CUSTOMER,
    columns: [
        'entityid',
        'email'
    ]
});

var myPagedResults = mySearch.runPaged({
    pageSize: 10
});

var thePageRanges = myPagedResults.pageRanges;

// Use PagedData.fetch(options) to retrieve a page of results (as a
// search.Page object) by index
var theData = myPagedResults.fetch({
    index: 5
});
...
// Add additional code 

        

Related Topics

search.PagedData
N/search Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices