DocumentCaptureTask.addInboundDependency(options)
|
Method Description |
Adds a scheduled script task as a dependent task to the document capture task. Dependent tasks are processed automatically using SuiteCloud Processors when the document capture task is complete. For more information, see SuiteCloud Processors. You can add a dependent task in the following ways:
Important:
You can add only scheduled scripts as dependent tasks to asynchronous document capture tasks. Other script types are not supported. You can add only one dependent task per call to When you use this method to add a dependent task, the added task is considered an inbound dependency of the document capture task. For example, if you add a scheduled script task to a document capture task as a dependent task, the scheduled script depends on the document capture task. Because |
|
Returns |
void |
|
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
|
Governance |
None |
|
Module |
|
|
Parent Object |
|
|
Sibling Object Members |
|
|
Since |
2025.2 |
Parameters
The options parameter is a JavaScript object.
|
Parameter |
Type |
Required / Optional |
Description |
|---|---|---|---|
|
|
string |
required |
The script ID of the scheduled script record for the dependent task. |
|
|
string |
required |
The type of dependent task. This property uses the |
|
|
string |
optional |
The script ID of the script deployment record for the dependent task. To use this property, the scheduled script for the dependent task must be deployed. If you do not specify a value for this property, an available deployment is selected automatically. |
|
|
Object |
optional |
The parameters for the scheduled script. To use this property, you must first create script parameters that are required for the dependent task. For example, if your dependent task requires a reference to the JSON result file, you must create a script parameter that maps the JSON result file ID to the file name, as in the following example:
For more information about script parameters, see Creating Script Parameters (Custom Fields). |
Errors
|
Error Code |
Thrown If |
|---|---|
|
|
The specified dependent task is not a scheduled script. |
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
...
// Be 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'
});
// myDocCaptureTask is an existing task.DocumentCaptureTask object
myDocCaptureTask.addInboundDependency(myScheduledScript);
...
// Add additional code