Scheduling a Map/Reduce Script Submission

Map/reduce script deployments can be submitted for processing on a scheduled basis. For example, you could configure the following schedules:

To set a scheduled submission, the Status field on the deployment record must be set to Scheduled. Additionally, you must configure one or more upcoming times on the record’s Schedule subtab.

Deployment times can be scheduled with a frequency of every 15 minutes. For example, you could configure a script to run at 2:00 pm, 2:15 pm, 2:30 pm, and so on.

The times you set on the Schedule subtab are the times the script deployment is submitted for processing. However, 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. 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 wait to be executed until other scripts have completed. For more details about how map/reduce scripts are processed, see SuiteCloud Processors.

Note that, regardless of the Status, the system submits the deployment for processing only if the Deployed box is checked. To stop execution of a map reduce script, you must uncheck the Deployed box. For more details on this choice, see Status.

Note:

The times displayed on the Schedule subtab use the session time zone, meaning that the times are displayed using the time zone of the user who is currently logged in. This time zone can be different from the time zone that is set for the company or the time zone of the map/reduce script owner.

To schedule a one-time or recurring map/reduce script submission:

  1. Create your map/reduce script entry point script. This process includes uploading a JavaScript file and creating a script record based on that file. To review a map/reduce script example, see SuiteScript 2.x Map/Reduce Script Type. If this script is your first, see SuiteScript 2.x Hello World and SuiteScript 2.x Entry Point Script Creation and Deployment.

  2. Open the appropriate script record in view mode. Click the Deploy Script button.

  3. When the script deployment record loads, check the Deployed box, if it is not already checked.

  4. Set the Status field to Scheduled.

  5. Set the remaining body fields. For help understanding the fields, see Map/Reduce Script Deployment Record.

  6. On the Schedule Subtab, set the deployment options.

    For example, if you wanted to submit the script hourly, you would configure the subtab as follows:

    • 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

    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.

  7. Click Save.

Note:

In some cases, you may want to submit a map/reduce script for processing multiple times simultaneously, or within a short time frame. However, the system does not permit a script deployment to be submitted if a previous instance of the deployment has already been submitted and is not yet finished. The solution in this case is to create multiple deployments for the script. In other words, repeat Steps 2 through 7 of the procedure above as needed.

Related Topics

Map/Reduce Script Submission
Map/Reduce Script Deployment Record
Submitting an On-Demand Map/Reduce Script Deployment from the UI
Submitting an On–Demand Map/Reduce Script Deployment from a Script
Submitting Multiple Deployments of the Same Script

General Notices