SearchTask.inboundDependencies

Note:

The content in this help topic pertains to SuiteScript 2.0.

Property Description

Key-value pairs that contain information about the dependent scripts added to the search task. Use this property to verify the properties of dependent scripts after you add the scripts using SearchTask.addInboundDependency().

This property uses nested objects to store information about each dependent script. A nested object is included for each dependent script added to the search task. The nested object contains information such as the task type, script ID, and deployment ID. It also includes the index of the script (starting at 0). Dependent scripts are indexed in the order they are added to the search task.

For example, consider a situation in which you add a scheduled script task and a map/reduce script task to a search task as dependent scripts. After you add the dependent scripts, but before you submit the search task using SearchTask.submit(), the value of the SearchTask.inboundDependencies property is similar to the following:

                    {"0": {"type":"task.ScheduledScriptTask", "scriptId":"customscript_as_ftr_ss", "deploymentId":"customdeploy_ss_dpl", "params": {"custscript_ss_as_srch_res":"SuiteScripts/ExportFile.csv"} },
"1": {"type":"task.MapReduceScriptTask", "scriptId":"customscript_as_ftr_mr", "deploymentId":"customdeploy_mr_dpl", "params": {"custscript_mr_as_srch_res":"SuiteScripts/ExportFile.csv"} }
} 

                  

After you submit the search task, the internal IDs of the dependent scripts are added to the SearchTask.inboundDependencies property:

                    {"0": {"type":"task.ScheduledScriptTask", "id":"SCHEDSCRIPT_0168697b126d1705061d0d690a787755500b046a1912686b10_349d94266564827c739a2ba0a5b9d476f4097217", "scriptId":"customscript_as_ftr_ss", "deploymentId":"customdeploy_ss_dpl", "params": {"custscript_ss_as_srch_res":"SuiteScripts/ExportFile.csv"} },
"1": {"type":"task.MapReduceScriptTask", "id":"MAPREDUCETASK_0268697b126d1705061d0d69027f7b39560f01001c_7a02acb4bdebf0103120b09302170720aa57bca4", "scriptId":"customscript_as_ftr_mr", "deploymentId":"customdeploy_mr_dpl", "params": {"custscript_mr_as_srch_res":"SuiteScripts/ExportFile.csv"} }
} 

                  

Type

Object[] (read-only)

Supported Script Types

Server scripts

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

Module

N/task Module

Since

2018.2

Errors

Error Code

Thrown If

READ_ONLY_PROPERTY

Setting the property is attempted

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 scheduledScript = task.create({
    taskType: task.TaskType.SCHEDULED_SCRIPT
});
// Set the properties of the scheduled script task
scheduledScript.scriptId = 'customscript_as_ftr_ss';
var mapReduceScript = task.create({
    taskType: task.TaskType.MAP_REDUCE
});
// Set the properties of the map/reduce script task
mapReduceScript.scriptId = 'customscript_as_ftr_mr';

asyncTask.addInboundDependency(scheduledScript);
asyncTask.addInboundDependency(mapReduceScript);

var asyncTaskId = asyncTask.submit();

// Iterate over the dependent scripts
var p = asyncTask.inboundDependencies;
for (var key in p) { log.debug(key + ' > ' + p[key]);
...
// Add additional code 

        

Related Topics

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

General Notices