Modules

filter

 

Objects/Functions

module (N/task)

SuiteScript 2.0

ScheduledScriptTask.submit()

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

N/task Module
ScheduledScriptTask.submit()
Method Description: Directs NetSuite to place a scheduled script deployment into the NetSuite scheduling queue and returns a unique ID for the task. Additionally, note the following: The scheduled script must have a status of Not Scheduled on the Script Deployment page. If the script status is set to Testing on the Script Deployment page, this method will not place the script into the scheduling queue. If the deployment status on the Script Deployment page is set to Scheduled, the script will be placed into the queue according to the time(s) specified on the Script Deployment page. Only roles with the SuiteScript Scheduling permission or Administrators can run scheduled scripts executed by API. If a user event script calls ScheduledScriptTask.submit(), the user event script must be initiated by a role with permission. A scheduled script can be submitted for processing only if there is no unfinished scheduled script task for the same script ID and script deployment ID. Therefore, if a scheduled script resubmits itself, the actual resubmit does not occur until the current execution completes. This delay is necessary to avoid the existence of two unfinished tasks for the same deployment of the same script. For this reason, if a scheduled script uses the submit() method to resubmit itself, then at runtime, no task ID is returned when the scheduled script is submitted.
Returns: string The task ID as a string, except as noted above.
Supported Script Types: Server scripts For more information, see SuiteScript 2.0 Script Types.
Governance: 20 units
Module: N/task Module
Since: 2015.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=ScheduledScriptTask.submit()

Example:

// Code Example 1
//Add additional code
//...
var scheduledScriptTaskId = scriptTask.submit();
//...
//Add additional code

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