Scheduling a Map/Reduce Script Submission
You can schedule map/reduce script deployments for processing. For example, you could configure the following schedules:
-
A one-time submission, at a predefined time.
-
Repeated submissions daily, weekly, monthly, or yearly.
To schedule a submission, set the Status field to . Scheduled. Additionally, you must configure one or more upcoming times on the record’s Schedule subtab.
You can schedule deployments 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 Schedule subtab sets when 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 might be a short delay before the script runs, even if no other scripts are ahead of it. If other scripts are waiting, this script will wait until they're done. For more details about how map/reduce scripts are processed, see SuiteCloud Processors.
The system only submits the deployment if the Deployed box is checked, regardless of the Status. ToTo stop a map/reduce script, uncheck the Deployed box. For more details on this choice, see Status.
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:
-
Create your map/reduce script entry point script. This involves uploading a JavaScript file and creating a script record from it. 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.
-
Open the appropriate script record in view mode. Click the Deploy Script button.
-
When the script deployment record loads, check the Deployed box, if it's not already checked.
-
Set the Status field to Scheduled.
-
Set the remaining body fields. For help understanding the fields, see Map/Reduce Script Deployment Record.
-
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's 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.
-
-
Click Save.
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 won't let you submit a script deployment if a previous instance is already submitted and not finished. To solve this, create multiple deployments for the script. In other words, repeat Steps 2 through 7 of the procedure above as needed.