Script Types
SuiteScript Scheduled Scripts
Using Scheduled Scripts
SuiteScript scheduled scripts run tasks on a schedule.
Introduction to Scheduled Scripts
SuiteScript scheduled scripts are designed to execute tasks at predefined times or intervals. They are particularly useful for automating repetitive processes, such as data imports, exports, or batch processing of records. This tutorial will guide you through the essentials of setting up and using scheduled scripts in NetSuite.
Key Concepts of Scheduled Scripts
Scheduled scripts in SuiteScript 2.0 are mainly characterized by their ability to handle large data processing jobs without user intervention. Here are some key points:
- Execution Context: Scheduled scripts run server-side and do not require user interaction.
- Suitability: Ideal for tasks that are too time-consuming to be run during normal user operations.
- Queue Management: Jobs can be queued and executed based on priority and resource availability.
Creating a Scheduled Script
To create a scheduled script in NetSuite, you must define a script file and a script deployment. The script file includes the logic to be executed, while the script deployment specifies the execution schedule.
Deploying a Scheduled Script
Once your script is ready, you need to deploy it. Deployment involves setting parameters such as the script's execution schedule, and other parameters like the audience and deployment status:
- Schedule: Define when and how often the script should run.
- Audience: Specify the roles that can trigger the script manually, if applicable.
- Status: Set to 'Released' to make the script active.
Defining the Execution Schedule
The execution schedule is a critical part of deploying a scheduled script. You can define schedules using intervals (e.g., daily, weekly) or specific dates and times. NetSuite provides a user-friendly interface to set up these schedules without needing to write additional code.
Script Types
- Previous
- User Event Scripts
- Next
- Suitelets