NetSuiteFree referencePDF, Excel, Word exportNetSuite

SuiteScript Script Types and Entry Points Reference

Choosing the wrong script type is one of the most common causes of governance errors and brittle customizations. This table lists each SuiteScript 2.x script type with its entry point functions and a typical use, so you can pick the right one and write the correct annotation.

Download:
Script type@NScriptType valueEntry pointsTypical useGovernance per execution
Client Script
ClientScript
pageInit, fieldChanged, postSourcing, sublistChanged, lineInit, validateField, validateLine, validateInsert, validateDelete, saveRecord
Form behavior and validation in the browser
1,000 units
User Event Script
UserEventScript
beforeLoad, beforeSubmit, afterSubmit
Logic when a record is viewed, saved or deleted on the server
1,000 units
Scheduled Script
ScheduledScript
execute
Batch jobs run on a schedule or on demand
10,000 units
Map/Reduce Script
MapReduceScript
getInputData, map, reduce, summarize
Large parallel processing with automatic yielding
10,000 units per function invocation, per stage rules apply
Suitelet
Suitelet
onRequest
Custom pages, forms and server-side endpoints
1,000 units
RESTlet
Restlet
get, post, put, delete
Custom REST endpoints for integrations
5,000 units
Portlet Script
Portlet
render
Custom dashboard portlets
1,000 units
Workflow Action Script
WorkflowActionScript
onAction
Custom action inside a SuiteFlow workflow
1,000 units
Mass Update Script
MassUpdateScript
each
Per-record logic for mass update jobs
Check Help Center for your release
Bundle Installation Script
BundleInstallationScript
beforeInstall, afterInstall, beforeUpdate, afterUpdate, beforeUninstall
Setup tasks when a SuiteApp is installed or updated
Check Help Center for your release

Governance numbers change by release and context. Treat the figures as planning guidance and confirm them in the SuiteScript governance documentation for your account before you design around them.

Review of your SuiteScript estate

Optional: send us a list of your scripts and deployments and we will suggest where to simplify.

Optional. The tool and every export work without this. No spam.

How to read the table

The annotation column is the exact value you place after @NScriptType in the file header. Entry points are the function names NetSuite expects the script to return from define(). Search for a function name such as afterSubmit to find which script type owns it. Export the table to share with a team or to include in a coding standard.

Picking a type by workload

Use a User Event script for logic tied to one record event, a Client script for browser validation, a Suitelet for a custom page and a RESTlet for an integration endpoint. For work that touches thousands of records, move to Scheduled or Map/Reduce. Map/Reduce is built for volume because it splits work into stages and yields automatically, while a Scheduled script must watch its own remaining usage.

  • Heavy work in a User Event slows every save and risks the usage limit.
  • Keep afterSubmit light and push long work to a queued task.
  • Never rely on client scripts alone for rules that must always hold.

Common mistakes

Developers often write heavy search loops inside beforeSubmit, which makes saves slow for every user. Another frequent error is putting security-sensitive validation only in a client script, which can be bypassed by imports, web services and scripts. Also check that the entry point names are spelled exactly, since a misspelled function is simply ignored and the script appears to do nothing.

Frequently Asked Questions

Which script type should I use for an integration?

A RESTlet is the usual choice for a custom inbound endpoint. For scheduled outbound sync, use a Scheduled or Map/Reduce script. Standard REST and SOAP web services may be enough without any script.

When should I choose Map/Reduce over Scheduled?

Choose Map/Reduce when you process many independent records and want parallelism and automatic governance handling. Choose Scheduled when the job is small, sequential or order dependent.

Can I run a User Event script on CSV import?

Yes. User Event scripts run on server-side saves including imports and web services, unless the script deployment or logic excludes that execution context. Check the context in your code if behavior should differ.

Are governance units the same for every account?

Not always. Limits are published per script type, but they can be revised between releases. Verify the current numbers in the Help Center before designing a high-volume script.

If you maintain a large estate of SuiteScript customizations and want help reviewing them, Netray and its partners can look at your scripts and suggest which to simplify or retire.