Modules
Objects/Functions
SuiteScript 2.0
{SearchTask}.addInboundDependency(){dependentScript: {task.ScheduledScriptTask | task.MapReduceScriptTask}})
N/task Module
SearchTask.addInboundDependency()
Method Description:
Adds a scheduled script task (task.ScheduledScriptTask) or map/reduce script task (task.MapReduceScriptTask) to the search task as a dependent script. Dependent scripts are processed automatically when the search task is complete. For more information, see SuiteCloud Processors.
You can add only scheduled scripts or map/reduce scripts as dependent scripts to asynchronous search tasks. Other script types are not supported.
When you use this method to add a dependent script, the script is considered an inbound dependency of the search task. The added script depends on the search task. For example, if you add a scheduled script task to a search task as a dependent script, the scheduled script depends on the search task. Because addInboundDependency() is called on the search task, any dependent scripts that you add are considered inbound dependencies.
Returns:
void
Supported Script Types:
Server scripts
For more information, see SuiteScript 2.0 Script Types.
Governance:
None
Module:
N/task Module
Since:
2018.2
Search NetSuite -
https://system.netsuite.com/app/help/helpcenter.nl?search=SearchTask.addInboundDependency()
Example:
// Code Example 1
// Add additional code
//...
var scheduledScript = task.create({
taskType: task.TaskType.SCHEDULED_SCRIPT
});
// Set the properties of the scheduled script task
scheduledScript.scriptId = 'customscript_as_ftr_ss';
//...
var asyncTask = task.create({
taskType: task.TaskType.SEARCH
});
// Set the properties of the search task
asyncTask.savedSearchId = 'customsearch35';
//...
asyncTask.addInboundDependency(scheduledScript);
var asyncTaskId = asyncTask.submit();
//...
// Add additional code
//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_1530711128.html