DocumentCaptureTask.submit()
|
Method Description |
Submits the document capture task for asynchronous processing. This method returns a unique ID for the document capture task. When the submission is successful, this method adds the script IDs of any dependent tasks (added using DocumentCaptureTask.addInboundDependency(options)) to the DocumentCaptureTask.inboundDependencies property. Use the task.DocumentCaptureTaskStatus object to view the status of a submitted document capture task. The task.checkStatus(options) method returns a task.DocumentCaptureTaskStatus object when you specify a task ID that represents a document capture task. |
|
Returns |
string |
|
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
|
Governance |
100 units |
|
Module |
|
|
Parent Object |
|
|
Sibling Object Members |
|
|
Since |
2025.2 |
Errors
|
Error Code |
Thrown If |
|---|---|
|
|
The document capture task was already submitted and completed successfully. |
|
|
A dependent scheduled script task is already submitted and is not complete. |
|
|
The status of the script deployment record for the specified dependent scheduled script task has a value other than “Not Scheduled”. |
|
|
A script deployment record for the specified dependent script task is not available for one of the following reasons:
|
|
|
The same dependent task is passed to this method more than one time. |
|
|
The specified dependent task is not found. |
|
|
The document capture task cannot be submitted due to an unexpected error. |
|
|
The DocumentCaptureTask.outputFilePath property specifies a folder and not a file. |
|
|
A required property is not specified. |
|
|
The DocumentCaptureTask.inputFile property references a file that does not exist. |
|
|
You do not have permission to access the file specified by the DocumentCaptureTask.inputFile property. |
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 myDocCaptureTask = task.create({
taskType: task.TaskType.DOCUMENT_CAPTURE
});
// Submit the task
var myTaskId = myDocCaptureTask.submit();
// Check the task status
var myStatus = task.checkStatus({
taskId: myTaskId
});
...
// Add additional code