There are many instances where scripts are only intended to run on specific instances. Some developers may have been used to filtering this out using a conditional record for scriptContext.type. But it can also be done using the Script Deployment Record. To do this:
- Open your Script Deployment record in Edit Mode.
- On the Event Type drop-down, select Create.
- Save.
Note: The Event Type field appears on Suitelet, User Event, and record-level Client script deployment pages only.
Important: Event types specified in the UI take precedence over the types specified in the script file. For example, if the create event type is specified in the script, selecting delete from the Event Type drop-down restricts the script from running on any event other than delete. If the Event Type field is left blank, your script will execute only on the event type(s) specified in the script file.
In case you missed it, we also have a guide on how to upload and deploy scripts in New To NetSuite | How to Deploy a Script Record.
—
Got any feedback? Let us know in the comments!