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.
Note:
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 |
Returns |
void |
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Since |
2018.2 |
Parameters
The options parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
required |
The script to add as a dependent script to the search task. Use task.create(options) and the task.TaskType enum to create a script task with a type of You can add only one dependent script per call to |
2018.2 |
Syntax
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 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