SearchTask.submit()

Note:

The content in this help topic pertains to SuiteScript 2.0.

Method Description

Directs NetSuite to initiate the asynchronous search task and return a unique ID for the task. When the submission is successful, this method adds the internal IDs of any dependent scripts (added using SearchTask.addInboundDependency()) to the SearchTask.inboundDependencies property.

Use task.SearchTaskStatus to view the status of a submitted task.

Returns

string

The task ID

Supported Script Types

Server scripts

For more information, see SuiteScript 2.x Script Types.

Governance

100 units

Module

N/task Module

Since

2017.1

Errors

Error Code

Thrown If

FAILED_TO_SUBMIT_JOB_REQUEST_1

The task cannot be submitted.

SSS_MISSING_REQD_ARGUMENT

A required parameter is missing.

YOU_DO_NOT_HAVE_ACCESS_TO_THE_MEDIA_ITEM_YOU_SELECTED

You do not have permission to access the file.

THAT_RECORD_DOES_NOT_EXIST

The file Object references a file that doesn’t exist.

MUST_IDENTIFY_A_FILE

The path specifies a folder and not a file.

CANNOT_RESUBMIT_SUBMITTED_ASYNC_SEARCH_TASK

The search task was already submitted and completed successfully.

ASYNC_SEARCH_DEPENDENCY_MR_ALREADY_SUBMITTED

A dependent map/reduce script is already submitted and is not complete.

ASYNC_SEARCH_DEPENDENCY_MR_INCORRECT_STATUS

The status of the deployment record for the specified dependent map/reduce script has a value other than “Not Scheduled”.

ASYNC_SEARCH_DEPENDENCY_SS_ALREADY_SUBMITTED

A dependent scheduled script is already submitted and is not complete.

ASYNC_SEARCH_DEPENDENCY_SS_INCORRECT_STATUS

The status of the deployment record for the specified dependent scheduled script has a value other than “Not Scheduled”.

ASYNC_SEARCH_DEPLOYMENT_FOR_DEPENDENCY

A deployment record for the specified dependent script is not available for one of the following reasons:

  • A deployment record was not specified when the dependent script was created, and automatic lookup for an available deployment record failed.

  • The deployment record specified when the dependent script was created is not found.

ASYNC_SEARCH_MULTIPLE_DEPENDENCIES

The same dependent script is passed to this method more than one time.

ASYNC_SEARCH_SCRIPT_ID_NOT_FOUND

The specified dependent script is not found.

ASYNC_SEARCH_SEARCH_ID_NOT_FOUND

The search task with the specified search ID is not found.

Syntax
Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/task Module Script Samples.

          //Add additional code 
...
var searchTriggerTask = searchTask.submit();
...
//Add additional code 

        

Related Topics

task.SearchTask
N/task Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices