task.SuiteQLTask

Note:

The content in this help topic pertains to SuiteScript 2.0.

Object Description

An asynchronous SuiteQL task. Use the methods and properties for this object to submit a SuiteQL task to the NetSuite task queue and execute it asynchronously.

You can create a task.SuiteQLTask object using task.create(options). You can populate the properties of this object as you create it. With a task.SuiteQLTask object, you can do the following:

  • Specify the SuiteQL query to submit using the SuiteQLTask.query property. This property accepts a string that represents a SuiteQL query. For more information, see SuiteQL.

  • Provide parameters to use in the SuiteQL query using the SuiteQLTask.params property.

  • Set the file ID or file path of a CSV file in the File Cabinet. SuiteQL query results are exported to this file. Use the SuiteQLTask.fileId property to specify a file ID, or use the SuiteQLTask.filePath property to specify a file path. Only one of these properties can be set at the same time. If both are set, an error occurs.

  • Add dependent tasks to the SuiteQL task using SuiteQLTask.addInboundDependency(options). Dependent tasks are processed automatically when the SuiteQL task is complete.

  • Submit the SuiteQL task to the task queue using SuiteQLTask.submit().

  • Get the status of a SuiteQL task using the properties of an associated task.SuiteQLTaskStatus object. The task.checkStatus(options) method returns a task.SuiteQLTaskStatus object when you specify a task ID that represents a SuiteQL task.

Supported Script Types

Server scripts

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

Module

N/task Module

Methods and Properties

SuiteQLTask Object Members

Since

2020.2

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
});
...
// Add additional code 

          

Related Topics

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

General Notices