Modules

filter

 

Objects/Functions

module (N/task)

SuiteScript 2.0

QueryTask.addInboundDependency(options)

{QueryTask}.addInboundDependency({scriptId: {string*},taskType: {string*},deploymentId: {string},params: {Object}})

N/task Module
QueryTask.addInboundDependency()
Method Description: Adds a scheduled script task or map/reduce script task as a dependent task to the query task. Dependent tasks are processed automatically using SuiteCloud Processors when the query task is complete. For more information, see SuiteCloud Processors. You can add a dependent task in the following ways: Provide a task.ScheduledScriptTask object or task.MapReduceScriptTask object that represents the dependent task as the only parameter to this method. Provide an Object as the only parameter that includes values for the following properties: taskType scriptId deploymentId (optional) params (optional) For descriptions of these properties, see Parameters. You can add only scheduled scripts or map/reduce scripts as dependent tasks to asynchronous query tasks. Other script types are not supported. You can add only one dependent task per call to QueryTask.addInboundDependency(options). When you use this method to add a dependent task, the added task is considered an inbound dependency of the query task. For example, if you add a scheduled script task to a query task as a dependent task, the scheduled script depends on the query task. Because QueryTask.addInboundDependency(options) is called on the query task, any dependent task that you add is considered an inbound dependency.
Returns: void
Supported Script Types: Server scripts For more information, see SuiteScript 2.0 Script Types.
Governance: None
Module: N/task Module
Parent Object: task.QueryTask
Sibling Object Members: QueryTask Object Members
Since: 2020.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=QueryTask.addInboundDependency(options)

Example:

// Code Example 1
{
'custscript_query_res' : 'resultFile.csv'
}

// Code Example 2
// Add additional code
//...
// Make sure to use a script ID that represents a scheduled script in your account
var myScheduledScript = task.create({
taskType: task.TaskType.SCHEDULED_SCRIPT,
scriptId: 'customscript_as_ftr_ss'
});

// myQueryTask is an existing task.QueryTask object
myQueryTask.addInboundDependency(myScheduledScript);
//...
// Add additional code

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