Scheduling a One Time or Recurring Scheduled Script Submission

Important:

Before you submit a scheduled script, make sure you know how SuiteCloud Processors works.

You can set up scheduled scripts to run once in the future or on a regular daily, weekly, monthly, or yearly schedule. Make sure the Status field is set to Scheduled in the deployment record.

You can schedule deployment times every 15 minutes—like 2:00 pm, 2:15 pm, 2:30 pm, and so on.

On the Script Deployment page, the times you set in the Schedule subtab are when your script is submitted for processing—not the exact times it’ll actually run. For example, setting it to 2:00 pm, 2:15 pm, and 2:30 pm doesn’t guarantee execution right on the dot.

Set a scheduled script’s deployment status to Scheduled if:

Important:

After you submit a script, there might be a short delay before it runs—even if nothing else is queued. If other scripts are already waiting, yours will have to wait for them to finish.

To set up a one-time or recurring scheduled script:

  1. First, create your scheduled script entry point—this means your JavaScript file and its script record. For examples, check out SuiteScript 2.x Scheduled Script Type Code Sample or, if you're new, see SuiteScript 2.x Hello World and SuiteScript 2.x Entry Point Script Creation and Deployment.

  2. On the script record, click Deploy Script.

  3. When the deployment record loads, make sure the Deployed box is checked—you can’t submit the script unless it is.

  4. Review the field descriptions in Scheduled Script Deployment Record.

  5. Set the Status field to Scheduled.

  6. Fill in the other required fields.

  7. Set the deployment options on the Schedule Subtab.

    If you want the script to run hourly all day, use these sample values:

    • 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 you set Start Time to something besides 12:00 am—like 2:00 pm—the script starts at 2:00 pm and keeps running hourly till midnight. Then it waits until 2:00 pm the next day to start up again.

  8. Click Save.

Investigating Problems with Scheduled Script Submissions

After you submit the script, there might be a brief delay before it gets run, even if nothing else is queued.

If you think there’s too much of a delay, check the following before reaching out to NetSuite Customer Support.

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

  • Is one script waiting for another to finish? If jobs are queued because all processors are busy, it’s not a real dependency—but consider these cases:

    • Queue dependency: The job is using queues and depends on the job ahead of it in the same queue.

    • Async search dependency: Scheduled and map/reduce scripts can be set up to run after an async search task finishes—they’ll only start once that task is done.

You might also see delays if there are:

  • Database access problems

  • Intermittent network connectivity problems

  • A required restart of system components

If you’re still seeing long wait times, contact Customer Support and give them the details. Here’s how you can tell if your scripts are using the old or new queue:

  • If you have the Application Performance Monitoring SuiteApp:

    • Go to Customization > Performance > SuiteCloud Processors Monitor. In the Overview portlet, sort by average wait time to help Support. Jobs on the old queue have a number in the Queue column; "-None-" means the job uses the dynamic system.

    • You can also check the Script Queue Monitor and SuiteCloud Processors Job Details pages.

  • If you don’t have the APM SuiteApp, go to the Scheduled Script Status Page. If you see a number in the Queue column, that’s the old queue; if it’s blank, it’s dynamic.

  • You can also check the Script Deployment record: if there’s a Remove Queue button or a Queue (Deprecated) field, that script’s using the old queue system.

Related Topics

General Notices