SuiteScript 2.x Modules

Explore SuiteScript 2.x modules for efficient script development and optimized permissions for NetSuite users.

·3 min read·View Oracle Docs

SuiteScript 2.x APIs are organized into various modules, each serving specific functionalities that enhance the script development experience and performance in NetSuite. It's essential to load only the relevant modules required for your script to avoid unnecessary overhead.

What Are SuiteScript 2.x Modules?

The SuiteScript 2.x framework includes a variety of modules, each designed for particular tasks. Here's a comprehensive overview:

ModuleDescriptionSupported Script TypesPermissions
N/actionExecutes business logic to update the state of a record, emulating user interface actions.Client and server scripts-
N/authChanges NetSuite login credentials.Server scripts-
N/cacheEnables data caching to improve performance.Server scripts-
N/certificateControlProvides access to the Digital Certificates list for digital signing.Server scriptsCertificate Management
N/commerceAccesses web store assets like items and shopping cart data.Client and server scripts-
N/compressCompresses and decompresses files.Server scripts-
N/configAccesses NetSuite configuration settings.Server scripts-
N/cryptoIncludes hashing and encryption capabilities.Server scripts-
N/crypto/certificateSigns XML documents with digital certificates using asymmetric cryptography.Server scriptsCertificate Access
N/currencyWorks with exchange rates within your NetSuite account.Client and server scripts-
N/currentRecordAccesses the record instance currently being worked on.Client scripts-
N/documentCaptureExtracts text content from supported documents.Server scriptsSuiteScript 2.1 only
N/emailSends email messages from within NetSuite.Client and server scripts-
N/errorCreates custom SuiteScript errors for better error handling.Server scripts-
N/fileInteracts with files in NetSuite.Server scripts-
N/logProvides logging methods to document script execution.Client and server scriptsLimitations apply to client scripts
N/queryCreates and runs searches using SuiteAnalytics Workbook.Client and server scriptsSuiteAnalytics Workbook
N/ui/dialogBuilds modal dialogs for user interaction.Client scripts-
N/ui/messageDisplays messages in the NetSuite interface.Client scripts-
N/utilAccesses utility methods for scripting.Client and server scripts-

Best Practices

  1. Load Only Required Modules: Optimize script performance by only including modules you need.
  2. Understand Permissions: Be aware of the permissions required to access different modules and ensure that your role settings are properly configured.
  3. Familiarize with Script Types: Different modules support various script types; ensure compatibility when developing your extensions.

Who This Affects

  • Developers: Need to understand and effectively utilize SuiteScript modules in their work.
  • Administrators: Responsible for setting up roles and permissions linked to SuiteScript usage.

Key Takeaways

  • SuiteScript 2.x modular structure enhances development flexibility.
  • Each module has specific functionalities tailored for various script types.
  • Proper role configuration is crucial for utilizing SuiteScript modules effectively.

Source: This article is based on Oracle's official NetSuite documentation.

Frequently Asked Questions (4)

What are the permissions required to use the N/certificateControl module in SuiteScript 2.x?
The N/certificateControl module in SuiteScript 2.x requires the Certificate Management permission to access the Digital Certificates list for digital signing.
Are all SuiteScript 2.x modules available for both client and server scripts?
No, not all SuiteScript 2.x modules are available for both client and server scripts. For example, the N/auth module is available only for server scripts, while modules like N/email and N/config are available for both.
What are the best practices for loading modules in SuiteScript 2.x?
One of the best practices for loading modules in SuiteScript 2.x is to load only the modules you need for your script to avoid unnecessary overhead and optimize script performance.
Is the N/documentCapture module available in all versions of SuiteScript 2.x?
No, the N/documentCapture module is only available in SuiteScript 2.1 and not in earlier versions.
Source: SuiteScript 2.x Modules 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 SuiteScript

View all SuiteScript articles →