Custom Tool Script Objects Integration in NetSuite

Updated for NetSuite 2026.2 with the custom tool object definition XML filename. Starting in NetSuite 2026.2, custom tool script objects provide developers and

·2 min read·31 views·View Oracle Docs

Starting in NetSuite 2026.2, custom tool script objects provide developers and administrators with a mechanism to extend the platform's capabilities using script files. This approach is particularly useful for integrating bespoke logic with your existing NetSuite environment. Let's delve into a custom tool script object setup, unraveling its components and best practices.

Custom Tool Script Object Example

Consider a custom tool object labeled Report Tool. This particular setup references a JavaScript file, report.js, and an associated JSON schema file, report_schema.json. Both of these files reside within the SuiteApps directory and are pivotal for defining the tool's functional capabilities. The object definition XML file is named custtoolset_reports.xml.

Here's a look at the XML definition:

xml
1<toolset scriptid="custtoolset_reports">
2 <name>Report Tool</name>
3 <scriptfile>[/SuiteApps/com.netsuite.tools/tools/report.js]</scriptfile>
4 <rpcschema>[/SuiteApps/com.netsuite.tools/tools/report_schema.json]</rpcschema>
5 <exposetoaiconnector>T</exposetoaiconnector>
6 <permissions>
7 <permission>
8 <permkey>LIST_EMAILTEMPLATE</permkey>
9 <permlevel>FULL</permlevel>
10 </permission>
11 <permission>
12 <permkey>ADMI_CRMLIST</permkey>
13 <permlevel>VIEW</permlevel>
14 </permission>
15 </permissions>
16</toolset>

Components Breakdown

  • Script ID: The scriptid attribute uniquely identifies the toolset within NetSuite.
  • Name: Defined by the <name> tag, this is the display name for the tool.
  • Script File: The <scriptfile> tag links to the JavaScript file implementing the tool's logic.
  • RPC Schema: The <rpcschema> specifies where to find the JSON schema needed for data validation and structure.
  • AI Connector Exposure: The <exposetoaiconnector> tag set to T indicates that the tool is available for integration with AI connectors.
  • Permissions: Here, specific permissions (<permission>) are required for various levels of access, ensuring that only authorized users can interact with the tool. Fine-grain these permissions according to your organization's security protocols.

Best Practices

  • Scripting Best Practices: Always keep your script files organized within the SuiteApps directory for easy maintenance and updates.
  • Schema Validity: Ensure your JSON schema is precise and validated to prevent runtime errors.
  • Permission Management: Regularly review and update permissions to reflect any changes in organizational roles or security policies.

NetSuite offers a flexible architecture allowing for seamless integration of custom tools. Utilizing components like the Report Tool enhances data manipulation and reporting, enabling businesses to leverage custom workflows effectively.

Key Takeaways

  • Custom tool script objects extend NetSuite's capabilities by integrating custom scripts.
  • Utilize clear identifiers and structured permissions for effective security and functionality.
  • Organize script and schema files within the SuiteApps directory for maintenance ease.
  • Regularly validate JSON schemas to ensure trouble-free operation within NetSuite interfaces.

Frequently Asked Questions (4)

Where should I place the JavaScript and JSON schema files for a custom tool script object in NetSuite?
Place both the script file and its JSON schema within the SuiteApps directory. The example shows report.js and report_schema.json under /SuiteApps/com.netsuite.tools/tools.
How do I expose a custom tool to AI connectors in the toolset XML definition?
Include the <exposetoaiconnector> tag in the toolset XML and set it to T. In the example, <exposetoaiconnector>T</exposetoaiconnector> makes the tool available for AI connector integration.
How are permissions defined for a custom tool script object in the XML?
Permissions are listed inside a <permissions> block with one or more <permission> entries. Each <permission> contains a <permkey> and a <permlevel>, for example LIST_EMAILTEMPLATE with permlevel FULL and ADMI_CRMLIST with permlevel VIEW.
What is the XML object definition filename used in the Report Tool example?
The object definition XML file shown in the example is named custtoolset_reports.xml. The XML uses a <toolset> element with a scriptid attribute of custtoolset_reports.

Weekly Update History (1)

SuiteCloud Development Frameworkupdated

Updated Custom Tool Scripts as XML Definitions to include information about the deprecation of the tool SDF custom object.

View Oracle Docs
Source: Example of a Custom Tool Script Object — Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in SuiteCloud Development Framework

View all SuiteCloud Development Framework articles →