Basics

SuiteScript Running Code

Running SuiteScript Code

SuiteScript code runs in NetSuite via scripts like Suitelets or scheduled scripts.

Understanding SuiteScript Execution

SuiteScript is a powerful tool that allows developers to extend NetSuite's capabilities by running custom scripts. These scripts can be executed in different contexts within the NetSuite environment, such as through Suitelets, scheduled scripts, user events, and more. Understanding where and how these scripts execute is crucial for developing efficient and effective solutions.

Suitelets: Custom Web Services

Suitelets are server-side scripts that act as custom web services or interactive web pages. They allow developers to create custom interfaces and business logic that extend NetSuite's standard functionality. Suitelets can be accessed via a URL and can handle GET and POST requests, making them highly versatile.

Scheduled Scripts: Automating Tasks

Scheduled scripts are designed to run without user interaction at a specified time or interval. They are ideal for automating routine tasks such as data imports, exports, or batch processing. These scripts are triggered by the NetSuite scheduler, making them perfect for tasks that need to be performed regularly.

User Event Scripts: Real-time Execution

User event scripts are executed in response to user actions on records, such as creating, editing, or deleting a record. They are used to enforce business rules and trigger additional processing during these events.