Contact Us 1-800-596-4880

Configuring Query Operations

Configure the operations that read collections of NetSuite data with automatic pagination: SuiteQL Query and Get All Records.

Both operations paginate automatically and return an array of messages, so you can use a For Each scope to process individual rows or records. Pagination attributes are available on each item’s message attributes. For full parameter, output, and error details, see NetSuite REST Connector Reference.

Configure the SuiteQL Query Operation

The SuiteQL Query operation runs a SuiteQL query against NetSuite data with automatic pagination by sending POST /query/v1/suiteql. SuiteQL is a SQL-like query language for NetSuite records.

To configure the SuiteQL Query operation:

  1. Select the operation on the Anypoint Code Builder or Studio canvas.

  2. In the General properties tab for the operation, enter these values:

    • Query

      The SuiteQL query string (for example, SELECT id, companyname FROM customer WHERE companyname LIKE 'A%').

    • Page Size

      Number of rows per page, which maps to the REST API limit parameter. Defaults to 100.

    • Max Total Results

      Maximum total rows to return across all pages. Defaults to 100000, which matches NetSuite’s hard cap per query. Set to -1 for unlimited, but NetSuite returns an error if the result set exceeds 100,000 rows.

XML Configuration

This is the XML for this operation:

<ms-netsuite-rest:suiteql-query
    config-ref="Config"
    doc:name="SuiteQL Query"
    query="SELECT id, companyname FROM customer WHERE companyname LIKE 'A%'"
    pageSize="100"/>

Output Configuration

The operation outputs an array of messages, each with a Binary payload (one SuiteQL row as JSON) and NetSuiteRestAttributes. Pagination attributes such as hasMore and offset are available on each item.

Configure the Get All Records Operation

The Get All Records operation retrieves a collection of records with automatic pagination and optional filtering by sending GET /record/v1/{recordType}. It returns ID stubs, so use Get Record to fetch full record bodies.

To configure the Get All Records operation:

  1. Select the operation on the Anypoint Code Builder or Studio canvas.

  2. In the General properties tab for the operation, enter these values:

    • Record Type

      The NetSuite record type (for example, customer, salesOrder, or invoice).

    • Filter Query

      Optional NetSuite filter expression (for example, email IS john@example.com). For complex queries, use SuiteQL Query instead.

    • Page Size

      Number of records per page, which maps to the REST API limit parameter. Defaults to 100.

    • Max Total Results

      Maximum total records to return across all pages. Defaults to -1 (unlimited).

XML Configuration

This is the XML for this operation:

<ms-netsuite-rest:get-all-records
    config-ref="Config"
    doc:name="Get All Records"
    recordType="customer"
    filterQuery="email IS john@example.com"
    pageSize="100"/>

Output Configuration

The operation outputs an array of messages, each with a Binary payload (one record ID stub) and NetSuiteRestAttributes. Pagination attributes such as hasMore, offset, and links are available on each item.