Skip to Content

NetSuite v2 (Beta) Saved Search activity in Jitterbit Studio

Introduction

A NetSuite v2 (Beta) Saved Search activity, using its NetSuite v2 (Beta) connection, runs an existing NetSuite saved search and is intended to be used as a source to provide data in an operation.

Caution

Oracle advises against using saved searches for tasks that need raw data for processing, since saved searches create full record objects and add overhead such as pagination, governance checks, and JSON serialization. For more information, see Oracle's Optimize Data Access and Queries documentation.

Note

This connector is currently in beta. To provide feedback, contact the Jitterbit Product Team.

Prerequisites

When using the RESTlet-based discovery saved search schema discovery mode, this activity requires a metadata RESTlet script to be deployed in the NetSuite account. A valid metadata RESTlet script is available for download on the Harmony Downloads page.

After deploying the script, find its path in the URL field on the script deployment record (Customization > Scripting > Script Deployments), for example https://<accountID>.restlets.api.netsuite.com/app/site/hosting/restlet.nl?script=166&deploy=1:

NetSuite v2 RESTlet location

Enter the path starting from /app/... in the activity's Metadata RESTlet Script Path field.

Important

Do not modify the body of the downloaded metadata RESTlet script.

Create a NetSuite v2 (Beta) Saved Search activity

An instance of a NetSuite v2 (Beta) Saved Search activity is created from a NetSuite v2 (Beta) connection using its Saved Search activity type.

To create an instance of an activity, drag the activity type to the design canvas or copy the activity type and paste it on the design canvas. For details, see Creating an activity instance in Component reuse.

An existing NetSuite v2 (Beta) Saved Search activity can be edited from these locations:

Configure a NetSuite v2 (Beta) Saved Search activity

Follow these steps to configure a NetSuite v2 (Beta) Saved Search activity:

Step 1: Specify schema discovery settings

In this step, provide a name for the activity and specify how the saved search's response schema is discovered. Each user interface element of this step is described below.

  • Endpoint menu: If you have multiple endpoints of the same connector type configured, a menu at the top of the screen displays the current endpoint name. Click the menu to switch to a different endpoint. For more information, see Change the assigned endpoint in Configuration screens.

    • Edit endpoint: Appears when you hover over the current endpoint name. Click to edit the currently selected endpoint's connection configuration.
  • Name: Enter a name to identify the activity. The name must be unique for each NetSuite v2 (Beta) Saved Search activity and must not contain forward slashes / or colons :.

  • Saved Search Schema Discovery Mode: Select how the saved search's response schema is discovered, one of:

    • Auto Introspection: (Default.) Samples one or more rows from a live run of the saved search and merges them into one representative row (the union of every field seen across the sampled rows), so a single sampled row's missing fields don't limit the generated schema. When selected, this field is visible:

      • Sample size: Enter the number of result rows to sample, from 1 to 20. Default: 1. Raise this value to catch fields that are null or absent in the first sampled row.
    • RESTlet-based discovery: Calls a metadata RESTlet script deployed in the NetSuite account to retrieve the saved search's column definitions, instead of sampling live data. When selected, this field is visible:

      • Metadata RESTlet Script Path: Enter the deployed metadata RESTlet's script path (for example, /app/site/hosting/restlet.nl?script=166&deploy=1); see Prerequisites.
    • File Upload: Provide a custom response schema instead of sampling the saved search. When selected, this is presented in Step 3: Provide a response schema.

      Important

      Only a JSON file can be selected for the schema. The schema's structure must also match the JSON NetSuite returns when the saved search is called directly (for example, from Postman); a JSON file with a different structure doesn't cause an error, but instead returns an empty response with a warning.

  • Next: Click to temporarily store the configuration for this step and continue to the next step. The configuration will not be saved until you click the Finished button on the last step.

  • Discard changes: After making changes, click to close the configuration without saving changes made to any step. A message asks you to confirm that you want to discard changes.

In this step, select the saved search to run and specify optional settings. Each user interface element of this step is described below.

Tip

Fields with a variable icon support using global variables, project variables, and Jitterbit variables. Begin either by typing an open square bracket [ into the field or by clicking the variable icon to display a menu listing existing variables to choose from.

  • Saved Search: Select how to specify the saved search to run, one of:

    • List available saved searches: (Default.) Choose from a list of saved searches already defined in the NetSuite account:

      • Select a Saved Search: This table displays saved searches already defined in the NetSuite account, with Title, Record Type, and ID columns.

      Tip

      This list is limited to the first 1,000 saved searches returned by NetSuite. If an expected saved search doesn't appear, use the Enter saved search ID option instead.

      Important

      This table lists only the saved searches NetSuite returns for the connection's credentials. If an expected saved search is still missing after accounting for the limit above, confirm with a NetSuite administrator that:

      • The NetSuite role associated with the connection's credentials is selected on the saved search's Audiences subtab.
      • The NetSuite user or role associated with the connection's credentials has access to all resources the saved search uses (for example, a record type, field, or related record referenced by the search).
    • Enter saved search ID: Select this option to manually enter the saved search's ID:

      • Saved Search ID: Enter the saved search's ID (for example, customsearch10).
  • Back: Click to temporarily store the configuration for this step and return to the previous step.

  • Next: Click to temporarily store the configuration for this step and continue to the next step. The configuration will not be saved until you click the Finished button on the last step.

  • Discard changes: After making changes, click to close the configuration without saving changes made to any step. A message asks you to confirm that you want to discard changes.

Step 3: Provide a response schema

Visible only when Saved Search Schema Discovery Mode was set to File Upload in Step 1. In this step, provide a custom response schema instead of sampling the saved search. Each user interface element of this step is described below.

  • Provide Response Schema: The response schema defines the structure of response data that is used by the NetSuite v2 (Beta) Saved Search activity. For instructions on completing this section of activity configuration, refer to Schemas defined in an activity.

    Important

    The schema provided (whether a saved schema or a new one) must be JSON, matching the structure NetSuite returns when the saved search is called directly; see Step 1.

  • Back: Click to temporarily store the configuration for this step and return to the previous step.

  • Next: Click to temporarily store the configuration for this step and continue to the next step. The configuration will not be saved until you click the Finished button on the last step.

  • Discard changes: After making changes, click to close the configuration without saving changes made to any step. A message asks you to confirm that you want to discard changes.

Step 4: Review the data schemas

Any request or response schemas are displayed. Each user interface element of this step is described below.

  • Data schema: These data schemas are inherited by adjacent transformations and are displayed again during transformation mapping.

    Note

    Data supplied in a transformation takes precedence over the activity configuration.

    The request schema consists of these fields, used to page through the saved search's results. Both are optional.

    Parameter Group Type Required Description
    limit query Integer No The maximum number of result rows to return.
    offset query Integer No The number of result rows to skip before returning results. Use with limit to page through results; the hasMore field in the response indicates whether more rows remain. To retrieve every page in a single run, see Handle pagination when reading from an API.

    The response schema returns these fields:

    • isSuccess: Whether the call succeeded.
    • statusCode: The HTTP status code returned by NetSuite.
    • result: The saved search's results, with links, count, hasMore, offset, and totalResults fields, and an items field containing the result rows. The fields available on each item depend on the selected saved search's own columns and on the Saved Search Schema Discovery Mode selected in Step 1.
    • errors: Any errors returned by the call, with cause and detailedMessage fields.

    The NetSuite v2 (Beta) connector uses NetSuite's SuiteTalk REST Web Services. Refer to the API documentation for additional information.

  • Back: Click to temporarily store the configuration for this step and return to the previous step.

  • Finished: Click to save the configuration for all steps and close the activity configuration.

  • Discard changes: After making changes, click to close the configuration without saving changes made to any step. A message asks you to confirm that you want to discard changes.

Next steps

After configuring a NetSuite v2 (Beta) Saved Search activity, complete the configuration of the operation by adding and configuring other activities, transformations, or scripts as operation steps. You can also configure the operation settings, which include the ability to chain operations together that are in the same or different workflows.

Menu actions for an activity are accessible from the project pane and the design canvas. For details, see Activity actions menu in Connector basics.

NetSuite v2 (Beta) Saved Search activities can be used as a source with these operation patterns:

To use the activity with scripting functions, write the data to a temporary location and then use that temporary location in the scripting function.

When ready, deploy and run the operation and validate behavior by checking the operation logs.