Skip to Content

NetSuite v2 (Beta) Upsert activity in Jitterbit Studio

Introduction

A NetSuite v2 (Beta) Upsert activity, using its NetSuite v2 (Beta) connection, both updates existing records and inserts new records for a chosen NetSuite record type and is intended to be used as a target to consume data in an operation.

Note

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

Create a NetSuite v2 (Beta) Upsert activity

An instance of a NetSuite v2 (Beta) Upsert activity is created from a NetSuite v2 (Beta) connection using its Upsert 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) Upsert activity can be edited from these locations:

Configure a NetSuite v2 (Beta) Upsert activity

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

Step 1: Enter a name and select a record type

In this step, provide a name for the activity, select a record type, 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.

  • 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) Upsert activity and must not contain forward slashes / or colons :.

  • Select a Record Type: Browse and select the NetSuite record type to upsert (for example, Customer or SalesOrder).

    • Selected record type: After a record type is selected, it is listed here.

    • Search: Enter a value into the search box to filter the list of record types. The search is not case-sensitive. If record types are already displayed within the table, the table results are filtered in real time with each keystroke. To reload record types from the endpoint when searching, enter search criteria and then refresh, as described below.

    • Refresh: Click the refresh icon or the word Refresh to reload record types from the NetSuite v2 (Beta) endpoint. This may be useful if record types have been added to NetSuite. This action refreshes all metadata used to build the table of record types displayed in the configuration.

    • Selecting a record type: Within the table, click anywhere on a row to select a record type. Only one record type can be selected. The information available for each record type is fetched from NetSuite's REST Record API metadata catalog:

      • Name: The name of the record type.

    Tip

    If the table does not populate with available record types, the NetSuite v2 (Beta) connection may not be successful. Ensure you are connected by reopening the connection and retesting the credentials. If the connection is successful, the role used to connect may be missing permission for the record type, or the record type may require an account feature to be enabled; see Enable NetSuite record types.

  • Optional settings: Click to expand additional optional settings:

    • Continue on error: Select to continue the activity execution if an error is encountered for a dataset in a batch request. If any errors are encountered, they are written to the operation log.
  • Save & Exit: If enabled, click to save the configuration for this step and close the activity configuration.

  • 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 2: Select an operation

In this step, select an operation and specify optional settings. Each user interface element of this step is described below.

  • Select an Operation: Browse and select which update-or-insert operation to perform for the selected record type. NetSuite's upsert operation matches an existing record by its external ID. If no record with that external ID exists, NetSuite creates one; if a record with that external ID already exists, NetSuite updates it instead. For more information, see NetSuite's Using the Upsert Operation documentation. This upsert behavior is always listed as two separate operations, Insert or update record and Insert or update records, so you can choose whether to upsert a single record or a list of records. A record type can also list Update record and Update records operations, which update an existing record only, rather than inserting a new one when no match is found. The two upsert operations handle record identifiers differently; see Single record and multiple records upserts.

    • Selected operation: After an operation is selected, it is listed here.

    • Search: Enter a value into the search box to filter the list of operations. The search is not case-sensitive. If operations are already displayed within the table, the table results are filtered in real time with each keystroke. To reload operations from the endpoint when searching, enter search criteria and then refresh, as described below.

    • Refresh: Click the refresh icon or the word Refresh to reload operations from the NetSuite v2 (Beta) endpoint. This may be useful if operations have been added for the selected record type. This action refreshes all metadata used to build the table of operations displayed in the configuration.

    • Selecting an operation: Within the table, click anywhere on a row to select an operation. Only one operation can be selected. The information available for each operation is fetched from NetSuite's REST Record API metadata catalog:

      • Name: The name of the operation.

    Tip

    If the table does not populate with available operations, the NetSuite v2 (Beta) connection may not be successful. Ensure you are connected by reopening the connection and retesting the credentials.

    NetSuite accepts a maximum of 100 records in one batch request. The Insert or update records and Update records operations send their records as a batch request, so send no more than 100 records at a time. For more information, see NetSuite's Batch Operations documentation.

  • Optional settings: Click to expand additional optional settings:

    • Enable asynchronous processing: Select to have the upsert processed asynchronously by NetSuite. Not selected by default. When selected, the activity receives a job reference instead of an immediate record response, and the Get Job Status activity can then be used to retrieve the result. Using either the Insert or update records or Update records operation always processes the upsert asynchronously, regardless of this setting.
  • 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: 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 groups its parameters under params as path, query, and header, followed by a body field for the record's data. Parameters left empty are not sent to NetSuite. The request schema offers these parameters:

    Parameter Group Type Required Description
    id path String Yes, for operations that act on a single record For Insert or update record, the record's external ID prefixed with eid: (see NetSuite's Using External IDs documentation). For Update record, the record's internal ID. Operations that act on multiple records do not use this parameter; see Single record and multiple records upserts.
    replace query String No A comma-delimited list of sublist names on the record. All lines of each listed sublist are replaced with the lines in the request. See NetSuite's Replacing a Sublist documentation.
    replaceSelectedFields query Boolean No Default: false. When true, all fields that should be deleted by the request, including body fields, must be included in the replace parameter. See NetSuite's Updating a Record Instance documentation.
    X-NetSuite-PropertyNameValidation header String No Sets the strictness of property name validation. Valid values are Error, Warning, and Ignore. Default: Warning.
    X-NetSuite-PropertyValueValidation header String No Sets the strictness of property value validation. Valid values are Error, Warning, and Ignore. Default: Error.
    X-NetSuite-Idempotency-Key header String No A unique key (a UUID in string format) that ensures an asynchronous request runs only once. NetSuite ignores this value for a synchronous request. See NetSuite's REST Web Services Request Processing documentation.

    The Prefer header is not part of the request schema because the Enable asynchronous processing setting and the selected operation control it.

    NetSuite returns no body on success, so the response schema for each item returns these fields instead:

    • isSuccess: Whether the upsert succeeded.
    • id: The upserted record's ID. When Enable asynchronous processing is selected, or when using the Insert or update records or Update records operation, this is instead the job reference's ID derived from the endpoint's Location response header.
    • Location: The endpoint's Location response header value, identifying the upserted record. When Enable asynchronous processing is selected, or when using the Insert or update records or Update records operation, this identifies the job reference instead, which can be used with the Get Job Status activity to retrieve the result.
    • errors: Any errors returned by the upsert, 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.

  • Refresh: Click the refresh icon or the word Refresh to regenerate schemas from the NetSuite v2 (Beta) endpoint. This action also regenerates a schema in other locations throughout the project where the same schema is referenced, such as in an adjacent transformation.

  • 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.

Single record and multiple records upserts

NetSuite offers two upsert operations: Insert or update record for a single record and Insert or update records for multiple records at once. They handle record identifiers differently, so it is important to know which one you are using.

Single record upsert

The Insert or update record operation acts on one record at a time.

  • Identifier: The record's identifier goes in the params > path > id field of the request schema. Because the operation is an upsert, enter the record's external ID prefixed with eid: (for example, eid:external1234). NetSuite uses this value to build the request URL, which is the format it expects to find or create the record. The request fails without it. If the field is empty, the operation log shows an error similar to the following:

    The request is missing a required path parameter for the URL "<url>". Provide a value for the "path.id" property in the request payload.
    
  • Body fields: The externalId and id fields in the request body are separate from the path id field and do not replace it. They exist so that you can change the identifier of a record that already exists. The path tells NetSuite which record to act on, and the body tells it what the new value is. For example, to change a record's external ID from external1234 to external4321, send eid:external1234 in the params > path > id field and external4321 in the body's externalId field. The same applies to the body's id field.

  • Processing and output: The operation is synchronous unless you select Enable asynchronous processing in Step 2. It returns the ID of the upserted record. With asynchronous processing selected, it returns a job ID instead.

Multiple records upsert

The Insert or update records operation acts on a list of records.

  • Identifier: The operation does not use the params > path > id field. Instead, provide the external ID of each record in the body.

  • Processing and output: The operation is always asynchronous. Rather than returning the IDs of the records you upserted, it returns a job ID, which appears in the operation output in place of the record IDs. This is expected behavior, not an error, because NetSuite processes the records in the background after it accepts the request. Use the Get Job Status activity to retrieve the result.

Note

The identifier format in the params > path > id field depends on the operation. Insert or update record requires an external ID, and external IDs always take the eid: prefix. Update record requires the record's internal ID, which takes no prefix.

To tell which identifier fields an operation needs, review the request schema generated in Step 3. If the schema contains the params > path > id field, a value is required.

Next steps

After configuring a NetSuite v2 (Beta) Upsert 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) Upsert activities can be used as a target 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.