Modules

filter

 

Objects/Functions

module (N/task)

SuiteScript 2.0

RecordActionTask.submit()

{RecordActionTask}.submit(){FAILED_TO_SUBMIT_JOB_REQUEST_1: {Failed to submit job request: {reason}}})

N/task Module
RecordActionTask.submit()
Method Description: Submits a record action task script deployment for processing and returns its task ID. The record action task is processed by a background process which executes the specified record action for each record ID provided in the parameters. The overall task status as well as individual action results can be queried using the task.checkStatus() method.
Returns: string The task ID.
Supported Script Types: Server scripts For more information, see SuiteScript 2.0 Script Types.
Governance: 50 units
Module: N/task Module
Sibling Object Members: RecordActionTask Object Members
Since: 2019.1
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=RecordActionTask.submit()

Example:

// Code Example 1
//Add additional code
//...
{
var recordActionTask = task.create({taskType: task.TaskType.RECORD_ACTION});
recordActionTask.recordType = 'timebill';
recordActionTask.action = 'approve';
recordActionTask.params = [{recordId: 1, note: "this is a note for 1"},
{recordId: 5, note: "this is a note for 5"},
{recordId: 23, note: "this is a note for 23"}];

var handle = recordActionTask.submit();

var res = task.checkStatus({taskId: handle}); // returns a RecordActionTaskStatus object
log.debug('Initial status: ' + res.status);
});
//...
//Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_1544121926.html