Scheduling a One Time or Recurring Scheduled Script Submission

Important:

Before you submit a scheduled script instance for processing, you must understand how SuiteCloud Processors works.

Scheduled script instances can be submitted for processing at a predefined time in the future, or repeatedly on a regular daily, weekly, monthly, or yearly basis. To set a submission scheduled from the deployment record, the Status field must be set to Scheduled.

Deployment times can be scheduled with a frequency of every 15 minutes, for example 2:00 pm, 2:15 pm, 2:30 pm, and so on.

When you use the Script Deployment page to create the deployment of a script, the times you set on the Schedule subtab are the times the script is being submitted for processing. The times you set on the Schedule subtab are not necessarily the times the script will execute. Script deployment does not mean the script will execute precisely at 2:00 pm, 2:15 pm, 2:30 pm, and so on.

A scheduled script's deployment status should be set to Scheduled for the following reasons:

Important:

After a scheduled script instance is submitted for processing, there may be a short system delay before the script is executed, even if no scripts are before it. If there are scripts already waiting to be executed, the script may need to wait until other scripts have completed.

To schedule a one time or recurring scheduled script submission:

  1. First, create your scheduled script entry point script. This includes your JavaScript file and its associated script record. To review a scheduled script example, see Scheduled Script Sample. If this is your first script, see SuiteScript 2.x Hello World and SuiteScript 2.x Entry Point Script Creation and Deployment.

  2. On the associated script record, select the Deploy Script button.

  3. When the script deployment record loads, click the Deployed box if it is not already checked. A scheduled script cannot be submitted for processing unless this box is checked.

  4. Review the scheduled script deployment field descriptions at Scheduled Script Deployment Record.

  5. Set the Status field to Scheduled.

  6. Set the remaining body fields.

  7. On the Schedule Subtab, set all deployment options.

    If you want the schedule to submit hourly on a 24 hour basis, use the following sample values as a guide:

    • Deployed = checked

    • Daily Event = [radio button enabled]

    • Repeat every 1 day

    • Start Date = [today's date]

    • Start Time = 12:00 am

    • Repeat = every hour

    • End By = [blank]

    • No End Date = checked

    • Status = Scheduled

    • Log Level = Error

    • Execute as Role = Set to Administrator

    If the Start Time is set to any other time than 12:00 am (for example, it is set to 2:00 pm), the script will start at 2:00 pm, but then finish its hourly execution at 12:00 am. It will not resume until the next day at 2:00 pm.

  8. Click Save.

Investigating Problems with Scheduled Script Submissions

After a scheduled script instance is submitted for processing, there may be a short system delay before the script is executed, even if no scripts are scheduled before it.

If you feel that there is too long of a delay before the script is processed, ask the following questions before contacting NetSuite Customer Support for assistance.

  • Are you using the deprecated queuing system for scheduled scripts instead of the dynamic processor queuing system? If you are using the deprecated queue system, you should move your jobs to the dynamic processor queuing system. See Scheduled Script Deployments that Continue to Use Queues for more information.

  • Is there a dependency such that one script is not executing until another script completes? If jobs are waiting because all processors are utilized, it is not a real dependency. However, the following may apply:

    • Queue dependency – The job is a scheduled script job that is still using queues and it depends on the previous job in the queue into which it was submitted.

    • Async search dependency - a 2018.2 feature allows you to submit scheduled and map/reduce scripts for processing that depend on an async search task. These scripts can run only after the async search task has completed.

Other reasons for processing delays include:

  • Database access problems

  • Intermittent network connectivity problems

  • A required restart of system components

If you experience long wait times with scheduled script processing, please contact Customer Support and provide details. To help determine whether your scripts are queued in the deprecated work queue or in the dynamic processor queue, see the following:

  • If you have the Application Performance Monitoring SuiteApp installed:

    • Go to Customization > Performance > SuiteCloud Processors Monitor to gather details. The Overview portlet contains a list of jobs based on a certain timeline. Sorting this portlet by average wait time can greatly help Support investigate wait-time related cases. Jobs running on the deprecated work queue system have a number in the Queue column. However, if the Queue column displays "-None-" this indicates that the job is running on the dynamic processor queuing system.

    • You can also gather details from the Script Queue Monitor and the SuiteCloud Processors Job Details pages.

  • If you do not have the Application Performance Monitoring SuiteApp, go to the Scheduled Script status page to gather details. The Queue column will display a number for tasks running on the deprecated work queue system. The Queue column is blank for tasks running on the dynamic processor queuing system.

  • Another way to determine if a script is running on the deprecated work queue system is by checking the Script Deployment record. If the record has a Remove Queue button, or displays the Queue (Deprecated) field, this indicates that the script is still running on the deprecated work queue system.

Related Topics

Scheduled Script Submission
Scheduled Script Deployment Record
Scheduled Script Deployments that Continue to Use Queues
Submitting an On Demand Scheduled Script Instance from the UI
Submitting an On Demand Scheduled Script Instance from Another Script

General Notices