Collection Paging

Lists of record instances and the results of saved analytics workbook searches are returned in one or more pages. The results are displayed on multiple pages, with the default setting of 1000 results per page on a maximum of 1000 pages. This way you can return maximum one million results if you use SuiteAnalytics Connect. Without SuiteAnalytics Connect, you can display maximum 100 000 results.

You can also specify your own paging by adding the limit criteria to your request.

Note:

You can specify your criteria to return fewer than 1000 results per page. In this case, the overall number of returned results is lower, too, because a maximum of 1000 pages of results can be returned.

You can achieve more results by using the ODBC connector. For information, see Accessing the Connect Service Using an ODBC Driver.

The following is an example of a request for all instances of customer records, displaying two results per page:

          GET https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/customer?limit=2 

        

The following is an example of a response:

          {
    "links": [
        {
            "rel": "next",
            "href": "https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/account?limit=2&offset=2"
        },
        {
            "rel": "last",
            "href": "https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/account?limit=22&offset=2"
        },
        {
            "rel": "self",
            "href": "https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/customer?limit=2&offset=0"
        }
    ],
    "items": [
        {
            "links": [
                {
                    "rel": "self",
                    "href": "https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/customer/107"
                }
            ],
            "id": "107"
        },
        {
            "links": [
                {
                    "rel": "self",
                    "href": "https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/customer/41"
                }
            ],
            "id": "41"
        }
    ],
    "count": 2,
    "offset": 0,
    "hasMore": true,
    "totalResults": 3
} 

        

The values of the count, hasMore, and totalResults fields provide information about the results that can be retrieved in subsequent requests for other pages. Links to the last and next pages provide direct links that you can use to retrieve these pages.

You can retrieve the next page by sending a request with the offset value specified. The offset provides the index of the result from which you should start the requested page.

Note:

You can only set offset and limit values in a way that the offset is divisible by the limit. For example, Offset=20, Limit=10 or Offset=0, Limit=5

The following is an example of a request for the second (and last) page of results with all customers:

          GET https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/account?limit=2&offset=2 

        

The following is an example of a response:

          {
    "links": [
        {
            "rel": "prev",
            "href": "https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/customer?limit=2&offset=0"
        },
        {
            "rel": "first",
            "href": "https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/customer?limit=22&offset=0"
        },
        {
            "rel": "self",
            "href": "https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/customer?limit=2&offset=2"
        }
    ],
    "items": [
        {
            "links": [
                {
                    "rel": "self",
                    "href": "https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/customer/90"
                }
            ],
            "id": "90"
        }
    ],
    "count": 1,
    "offset": 2,
    "hasMore": false,
    "totalResults": 3
} 

        

Related Topics

Record Filtering and Query
Listing All Record Instances
Record Collection Filtering
Executing SuiteQL Queries Through REST Web Services
Working with SuiteAnalytics Datasets in REST Web Services

General Notices