Modules

filter

 

Objects/Functions

module (N/task)

SuiteScript 2.0

task.QueryTask

// Please search https://system.netsuite.com/app/help/helpcenter.nl?search=task.QueryTask for more information.

N/task Module
task.QueryTask
Object Description: An asynchronous query task. Use the methods and properties for this object to submit a query task to the NetSuite task queue and execute it asynchronously. You can create a task.QueryTask object using task.create(options). You can populate the properties of this object as you create it. With a task.QueryTask object, you can do the following: Specify the query to submit using the QueryTask.query property. This property accepts a query.Query object that was constructed using the N/query module. For more information, see N/query Module. Set the file ID or file path of a CSV file in the File Cabinet. Query results are exported to this file. Use the QueryTask.fileId property to specify a file ID, or use QueryTask.filePath 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 query task using QueryTask.addInboundDependency(options). Dependent tasks are processed automatically when the query task is complete. Submit the query task to the task queue using QueryTask.submit(). Get the status of a query task using the properties of an associated task.QueryTaskStatus object. The task.checkStatus(options) method returns a task.QueryTaskStatus object when you specify a task ID that represents a query task.
Supported Script Types: Server scripts For more information, see SuiteScript 2.0 Script Types.
Module: N/task Module
Methods and Properties: QueryTask Object Members
Since: 2020.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=task.QueryTask

Example:

// Code Example 1
// Add additional code
//...
var myQueryTask = task.create({
taskType: task.TaskType.QUERY
});
//...
// Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_159223655124.html