NetSuite REST Get Async Result

Overview

You can use this Snap to retrieve the detailed results of an asynchronous job submitted to NetSuite through the REST API.

The Snap reads the list of tasks in the job, retrieves the result of each task, and writes one output document for each record in the results. When a task result spans multiple pages, the Snap follows the pages up to the limit that you set in Pages.

Use this Snap after the job completes. To wait for the job to complete, place the NetSuite REST Check Async Status Snap upstream with Await final status selected.

This Snap is the REST equivalent of the NetSuite Get Async Result Snap in the NetSuite SOAP Snap Pack.


NetSuite REST Get Async Result Overview

Prerequisites

  • The ID of a completed asynchronous job submitted to NetSuite, such as the id field in the output of a NetSuite REST Snap that submits an asynchronous request.

Limitations and known issues

  • The Snap does not wait for the job to complete. If the job is still pending or processing, the job might not have task results yet, and the Snap writes no output for it.

Snap views

Type Description Examples of upstream and downstream Snaps
Input This Snap has exactly one document input view. Each input document supplies the values for the Job ID and Pages expressions.
Output This Snap has at the most one document output view. For a job that reads records, the Snap writes one output document for each record in the task results. For a job that writes records, the Snap writes the status of each operation. Each output document also includes the input document in the original field.
Learn more about Error handling.

Snap settings

Note: Learn about the common controls in the Snap settings dialog.
Field/Field set Description

Label*

String

Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline.

Default value: NetSuite REST Get Async Result

Example: Get customer upsert results

Job ID*

String/Expression

Specify the identifier of the asynchronous NetSuite job whose results you want to retrieve.

To retrieve the results of a job that an upstream Snap submitted or checked, map the id field from the output of that Snap.

Default value: N/A

Example: $id

Pagination parameters Use this field set to control the amount of data that the Snap retrieves from the NetSuite server.
Pages

Integer/Expression

Specify the number of pages to read from each task result. When the value is 0, the Snap reads all pages.

Default value: 0

Example: 5

Snap execution

Dropdown list
Choose one of the three modes in which the Snap executes. Available options are:
  • Validate & Execute: Performs limited execution of the Snap and generates a data preview during pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during pipeline runtime.
  • Execute only: Performs full execution of the Snap during pipeline execution without generating preview data.
  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Default value: Validate & Execute

Example: Execute only

Troubleshooting

Error Reason Resolution
No Job ID is provided. The Job ID expression evaluates to an empty value for the input document. Verify that the Job ID expression refers to a field that exists in the input document, such as $id.
Failed to execute the NetSuite REST service call, or the endpoint returned an error. NetSuite cannot find an asynchronous job with the specified ID. The error document shows the reason Got response 404 - Not Found from the endpoint. Verify that the Job ID value is correct and that the job was submitted with the same NetSuite account that this Snap uses.
Failed to execute the NetSuite REST service call, or the endpoint returned an error. NetSuite rejected the account credentials. The error shows the reason Got response 401 - Unauthorized from the endpoint. Validate the account, and update or reauthorize the credentials if they have expired.
Failed to execute the NetSuite REST service call, or the endpoint returned an error. NetSuite rejected the request. The error document shows the reason as Got response <code> - <status> from the endpoint, along with the details that NetSuite returns. Review the details in the error view, and correct the Job ID value or the account settings that NetSuite reports.
The Snap writes no output documents. The job has not completed, so it has no task results yet. Place the NetSuite REST Check Async Status Snap upstream with Await final status selected, so that this Snap runs only after the job completes.
Failed to prepare or send NetSuite request (<details>). The Snap could not send the request to NetSuite. Review the details in the error message, and verify the account settings and the network connectivity from the Snaplex to NetSuite.