Setting Your Script to Run With Administrative Privileges
Sometimes a script needs to do something the initiating user's role can't. In these cases, you can execute the script as Administrator so it can read or change restricted records-or perform other high-privilege tasks-without failing.
Choose Administrator in the deployment's Execute as Role field only when the script needs full privileges, regardless of who's logged in.
For example:
-
A script that creates follow-up tasks after a sales order is saved and needs to read employee records-data many sales roles can't access.
-
Bundle installation scripts always need Administrator rights.
-
Scripts that run without a NetSuite session-like web store scripts or Suitelets marked Available Without Login-when they need NetSuite data. For more information, see Setting Available Without Login.
To run a script as Administrator:
-
Go to Customization > Scripting > Script Deployments
-
Edit the deployment you want to change.
-
In Execute as Role, select Administrator.
-
Click Save.
Because the Administrator role gives unrestricted access, use it sparingly and only when other roles can't meet the script's needs.