Purpose of this query
This SuiteQL statement returns metadata for all scripts stored in the script table. It shows script name, script ID, script type, owner, description, inactive flag, inferred SuiteScript version, deployment status, and internal ID. This report helps administrators and developers audit custom scripts, identify inactive or legacy scripts, confirm ownership, and review SuiteScript 1.0 versus 2.x usage. Results are ordered by script type and name for easier review and organization.
SuiteQL
SELECT
s.name AS "Script Name",
s.scriptid AS "Script ID",
s.scripttype AS "Script Type",
BUILTIN.DF(s.owner) AS "Owner",
s.description AS "Description",
s.isinactive AS "Is Inactive",
CASE
WHEN s.scripttype IN ('ClientScript', 'UserEventScript', 'ScheduledScript', 'Suitelet', 'RESTlet') THEN 'SuiteScript 2.0+'
WHEN s.scripttype IN ('Client', 'UserEvent', 'Scheduled', 'Suitelet', 'RESTlet') THEN 'SuiteScript 2.0+'
ELSE 'SuiteScript 1.0'
END AS "SuiteScript Version",
CASE
WHEN s.isinactive = 'T' THEN 'Inactive'
WHEN s.isinactive = 'F' THEN 'Active'
ELSE 'Unknown'
END AS "Deployment Status",
s.id AS "Internal ID"
FROM
script s
ORDER BY
s.scripttype,
s.name;
Sample Output
How the query works
Pulling script metadata
The query reads from the script table, which stores all SuiteScript definitions in the account.
Displaying readable owner names
BUILTIN.DF(s.owner) converts the owner’s internal ID into a human-readable name so responsibility is clear.
Detecting SuiteScript version
The CASE expression classifies scripts as SuiteScript 2.0+ or SuiteScript 1.0 based on script type naming conventions. This helps identify modernization opportunities.
Determining deployment status
The isinactive field is translated into Active or Inactive so you can quickly spot scripts that are not currently running.
Including internal ID
The internal ID is helpful for scripting, automation, or cross-referencing with deployments.
Why this report is useful
• Script governance: quickly see which scripts exist, who owns them, and whether they are active.
• Version modernization: identify SuiteScript 1.0 scripts that may need upgrading to 2.x.
• Cleanup initiatives: find inactive or legacy scripts that can be retired.
• Audit and compliance: confirm script ownership and deployment status before upgrades.
• Environment comparison: export from sandbox and production to compare script inventories.
Customization notes
• Filter by script type: add WHERE s.scripttype = ‘UserEventScript’ or another type.
• Show only active scripts: add WHERE s.isinactive = ‘F’.
• Identify scripts without descriptions: add WHERE s.description IS NULL.
• Join to script deployment table if you want to review deployment records and execution contexts.
• Export to Excel and pivot by SuiteScript Version to visualize modernization progress.

