NetSuite v2 (Beta) Read activity in Jitterbit Studio
Introduction
A NetSuite v2 (Beta) Read activity, using its NetSuite v2 (Beta) connection, retrieves one or more records for a chosen NetSuite record type and is intended to be used as a source to provide data in an operation.
Note
This connector is currently in beta. To provide feedback, contact the Jitterbit Product Team.
Create a NetSuite v2 (Beta) Read activity
An instance of a NetSuite v2 (Beta) Read activity is created from a NetSuite v2 (Beta) connection using its Read 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) Read activity can be edited from these locations:
- The design canvas (see Component actions menu in Design canvas).
- The project pane's Components tab (see Component actions menu in Project pane Components tab).
Configure a NetSuite v2 (Beta) Read activity
Follow these steps to configure a NetSuite v2 (Beta) Read activity:
-
Step 1: Enter a name and select an operation
Provide a name for the activity, select an operation, and specify optional settings. -
Step 2: Select a record type
Select a record type. -
Step 3: Select response fields
Visible only when Get a Record (Single Record) is selected and Return subresource data is not enabled. Optionally restrict the response to specific fields. -
Step 4: Review the data schemas
Any request or response schemas are displayed.
Step 1: Enter a name and select an operation
In this step, provide a name for the activity, select an operation, 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) Read activity and must not contain forward slashes
/or colons:. -
Select an Operation: Select which read operation to perform for the selected record type, one of:
- Get a Record (Single Record): (Default.) Retrieves a single record identified by a record ID.
- Get List of Records (Multiple Records): Retrieves a list of records. NetSuite returns only the identifier of each record, not its field values.
Tip
To retrieve the full content of the records returned by Get List of Records (Multiple Records), use each returned record identifier with a second Read activity that uses the Get a Record (Single Record) operation.
To retrieve the content of a record type in a single call, consider using a Query activity if the record type's table is available. To make a table such as a custom record type available, see Make additional tables available.
-
Optional settings: Click to expand additional optional settings:
-
Enable asynchronous processing: Select to have the read processed asynchronously by NetSuite. Not selected by default. Using the
idsorexpandRecordsrequest parameters in a Read activity requires Enable asynchronous processing to be enabled. If either parameter is supplied while it is disabled, the activity fails with an error similar to:Error while executing the Read Activity. Enable activity Async mode to use "ids" or "expandRecords" parameters -
Return subresource data: Visible only when Get a Record (Single Record) is selected above. Select to have every read request automatically expand the record's sub-resources. Not selected by default. This is equivalent to always setting the
expandSubResourcesrequest parameter totrue, regardless of any value supplied for that parameter through the request schema or transformation. Without this setting, NetSuite returns only a link (href) to each of the record's sub-resources (for example, a transaction's line items) instead of the sub-resource data. When enabled, Step 3: Select response fields is hidden, since field selection doesn't apply when sub-resources are returned.Tip
If a record's line items, such as the items on an
itemFulfillmentrecord, are returned as anhreflink instead of data, select Return subresource data, or set theexpandSubResourcesrequest parameter totrue. You can also retrieve line items with a Query activity using a table such astransactionLine, which is available with version 1.1.0.0 or later of the metadata RESTlet script. -
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 a record type
In this step, select a record type. Each user interface element of this step is described below.
-
Select a Record Type: This section displays record types available in the NetSuite v2 (Beta) endpoint.
-
Selected record type: After a record type is selected, it is listed here.
-
Search: Enter any column's 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.
-
-
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: Select response fields
Visible only when Get a Record (Single Record) was selected in Step 1 and Return subresource data is not enabled. In this step, optionally restrict the response to specific fields. Each user interface element of this step is described below.
-
Select response fields: Move fields between Available fields and Selected fields to choose which top-level fields of the selected record type are returned. Leave Selected fields empty to return every field.
Caution
idis not automatically included in Selected fields. If the record's own ID is needed downstream (for example, to use in a subsequent Upsert or Delete activity), addidto Selected fields explicitly.Note
A
fieldsvalue entered directly into the request schema, such as through a transformation, always overrides this selection. -
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.
When the Get a Record (Single Record) operation is selected, the request schema includes a freeform field for the record ID to retrieve, in the
params>path>idfield. NetSuite uses this value to build the request URL, so the request fails without it.The request schema groups its parameters under
paramsaspath,query, andheader. All parameters are optional except the pathidof the Get a Record (Single Record) operation. Parameters left empty are not sent to NetSuite.For the Get a Record (Single Record) operation, the request schema offers these parameters:
Parameter Group Type Required Description idpathInteger Yes The internal ID of the record to retrieve. fieldsqueryString No A comma-separated list of the field and sublist names to return. Only the listed fields and sublists are returned. A value entered here overrides the selection in Step 3. See NetSuite's Getting a Record Instance documentation. expandSubResourcesqueryBoolean No Set to trueto expand all sublists, sublist lines, and subrecords on the record. Default:false. Selecting Return subresource data in Step 1 always sets this totrue.simpleEnumFormatqueryBoolean No Set to trueto return enumeration values in a format that shows only the internal ID value. Default:false.X-NetSuite-Idempotency-KeyheaderString 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. For the Get List of Records (Multiple Records) operation, the request schema offers these parameters, all in the
querygroup except the header:Parameter Type Required Description qString No A NetSuite query expression that limits the records returned to those matching a filter, for example email START_WITH barbara. Leave blank to return all records. For the syntax, see Filter expressions forqbelow and NetSuite's Record Collection Filtering documentation.limitInteger No The maximum number of records to return in a single response (page). Default: 1000.offsetInteger No The number of records to skip before returning results. Default: 0. Use withlimitto page through results. The value must be evenly divisible bylimit, a rule NetSuite enforces. ThehasMorefield in the response indicates whether more records remain. To retrieve every page in a single run, see Handle pagination when reading from an API.idsString No A comma-separated list of internal or external IDs of records to retrieve in a batch. Prefix each external ID with eid:; see NetSuite's Using External IDs documentation. Requires Enable asynchronous processing.expandRecordsBoolean No Set to trueto enable batch operations for the request. Requires Enable asynchronous processing.X-NetSuite-Idempotency-KeyString No (Header.) A unique key (a UUID in string format) that ensures an asynchronous request runs only once. NetSuite ignores this value for a synchronous request. The
qparameter uses NetSuite's own filter syntax, which the connector passes to NetSuite as entered. These guidelines apply:- Each condition consists of a field name, an operator, and a value, for example
email START_WITH barbara. - Join conditions with
ANDorOR, and use parentheses to control precedence.ANDtakes priority overOR. - Wrap a value that contains spaces in quotation marks, for example
firstname IS "Barbara Allen". -
The operators available depend on the field's data type:
Field type Common operators String CONTAIN,IS,START_WITHNumber EQUAL,GREATER,GREATER_OR_EQUAL,LESS,LESS_OR_EQUAL,BETWEEN,ANY_OFBoolean IS,IS_NOTDate AFTER,BEFORE,ON,ON_OR_AFTER,ON_OR_BEFOREAny EMPTY,EMPTY_NOTMost operators also have a negated variant that ends in
_NOT(for example,START_WITH_NOT). For the complete list, see NetSuite's Record Collection Filtering documentation. -
Only fields that NetSuite marks as filterable can be used in a filter expression. Filterable fields vary by record type and by NetSuite account, because custom fields are included. To find them, retrieve the record's metadata and look for fields with the
x-ns-filterableproperty; see NetSuite's Getting Metadata documentation.
These examples show valid values for
q:email START_WITH barbaradateCreated ON_OR_AFTER "1/1/2019" AND dateCreated BEFORE "1/1/2020"The
Preferheader is not part of the request schema because the Enable asynchronous processing setting controls it.The response schema differs depending on whether Enable asynchronous processing is selected:
-
With Enable asynchronous processing not selected, the response for each item consists of either the selected record type's own fields (for Get a Record (Single Record), narrowed to the fields chosen in Step 3, if any) or the list of record identifiers returned directly by NetSuite (for Get List of Records (Multiple Records)), plus
isSuccessanderrors. -
With Enable asynchronous processing selected, the response for each item instead returns:
isSuccess: Whether the read succeeded.id: The job reference's ID, derived from the endpoint'sLocationresponse header.Location: The endpoint'sLocationresponse header value, identifying the job reference. Can be used with the Get Job Status activity to retrieve the result.errors: Any errors returned by the read, withcauseanddetailedMessagefields.
The record's own fields are retrieved separately with the Get Job Status activity.
The NetSuite v2 (Beta) connector uses NetSuite's SuiteTalk REST Web Services. Refer to the API documentation for additional information.
- Each condition consists of a field name, an operator, and a value, for example
-
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.
Next steps
After configuring a NetSuite v2 (Beta) Read 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) Read activities can be used as a source with these operation patterns:
- Transformation pattern
- Two-target archive pattern (as the first source only)
- Two-target HTTP archive pattern (as the first source only)
- Two-transformation pattern (as the first or second source)
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.