SuiteQLTask.submit()

Note:

The content in this help topic pertains to SuiteScript 2.0.

Method Description

Submits the SuiteQL task for asynchronous processing.

This method returns a unique ID for the SuiteQL task. When the submission is successful, this method adds the script IDs of any dependent tasks (added using SuiteQLTask.addInboundDependency(options)) to the SuiteQLTask.inboundDependencies property.

Use the task.SuiteQLTaskStatus object to view the status of a submitted SuiteQL task. The task.checkStatus(options) method returns a task.SuiteQLTaskStatus object when you specify a task ID that represents a SuiteQL task.

Returns

string

Supported Script Types

Server scripts

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

Governance

100 units

Module

N/task Module

Parent Object

task.SuiteQLTask

Sibling Object Members

SuiteQLTask Object Members

Since

2020.2

Errors

Error Code

Thrown If

ASYNC_SUITEQL_DEPENDENCY_MR_ALREADY_SUBMITTED

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

ASYNC_SUITEQL_DEPENDENCY_MR_INCORRECT_STATUS

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

ASYNC_SUITEQL_DEPENDENCY_SS_ALREADY_SUBMITTED

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

ASYNC_SUITEQL_DEPENDENCY_SS_INCORRECT_STATUS

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

ASYNC_SUITEQL_DEPLOYMENT_FOR_DEPENDENCY

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

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

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

ASYNC_SUITEQL_MULTIPLE_DEPENDENCIES

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

ASYNC_SUITEQL_SCRIPT_ID_NOT_FOUND

The specified dependent task is not found.

ASYNC_SUITEQL_SUITEQL_ID_NOT_FOUND

A SuiteQL task with the specified script ID is not found.

CANNOT_RESUBMIT_SUBMITTED_ASYNC_SUITEQL_TASK

The SuiteQL task was already submitted and completed successfully.

FAILED_TO_SUBMIT_JOB_REQUEST_1

The SuiteQL task cannot be submitted due to an unexpected error.

MUST_IDENTIFY_A_FILE

The SuiteQLTask.filePath property specifies a folder and not a file.

SSS_MISSING_REQD_ARGUMENT

A required property is not specified.

THAT_RECORD_DOES_NOT_EXIST

The SuiteQLTask.fileId property or SuiteQLTask.filePath property references a file that does not exist.

YOU_DO_NOT_HAVE_ACCESS_TO_THE_MEDIA_ITEM_YOU_SELECTED

You do not have permission to access the file specified by the SuiteQLTask.fileId property or SuiteQLTask.filePath.

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 mySuiteQLTask = task.create({
    taskType: task.TaskType.SUITE_QL
});

// Submit the task
var myTaskId = mySuiteQLTask.submit();

// Check the task status
var myStatus = task.checkStatus({
    taskId: myTaskId
});
...
// Add additional code 

          

Related Topics

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

General Notices