New Preference for Executing SuiteScript 2.0 as SuiteScript 2.1
A new preference allows executing SuiteScript 2.0 scripts in a SuiteScript 2.1 environment to improve performance and compatibility checks.
Starting in NetSuite, a new company preference allows you to run all SuiteScript 2.0 server scripts in a SuiteScript 2.1 environment. This feature assists in verifying that existing SuiteScript 2.0 scripts operate correctly under the enhanced SuiteScript 2.1 runtime, which offers better performance and stability.
Why This Matters
This new preference enables developers to assess which of their existing SuiteScript 2.0 scripts are compatible with SuiteScript 2.1. If a script validates successfully with this preference enabled, it is advisable to update the script's annotation to take full advantage of the benefits in SuiteScript 2.1, such as improved performance derived from the Graal runtime engine, which now supports ECMAScript 2023 features.
How to Enable the Preference
To activate this feature, follow these steps:
- Navigate to Setup > Company > General Preferences.
- Check the box for Execute SuiteScript 2.0 Server Scripts as 2.1.
Compatibility Considerations
- Validation Impact: Only SuiteScript 2.0 server scripts deemed compatible with SuiteScript 2.1 will utilize this preference. Scripts that fail validation will continue to execute in the SuiteScript 2.0 environment.
- Existing Script Behaviors: Script records with the "Execute As" field set to 2.0 will not be affected and will continue to run as SuiteScript 2.0.
- Upgrade Recommendation: If your script validates without errors, consider changing its annotation to take advantage of the updates and enhancements available in SuiteScript 2.1, including new functions and features like the spread operator.
Conclusion
This preference provides crucial flexibility for developers transitioning to SuiteScript 2.1, allowing them to identify and optimize existing scripts while maintaining backward compatibility where necessary.
Who This Affects: This change is relevant for Developers and Administrators who manage SuiteScript implementations in their NetSuite environments.
Key Takeaways:
- A new preference allows running SuiteScript 2.0 scripts in a SuiteScript 2.1 environment for compatibility checks.
- Successful validation with this preference enables script migration to take advantage of SuiteScript 2.1 features.
- Users can activate this feature via General Preferences to improve performance and stability.
Source: This article is based on Oracle's official NetSuite documentation.
Frequently Asked Questions (4)
How do I enable the preference to execute SuiteScript 2.0 scripts in a SuiteScript 2.1 environment?
Will enabling this preference affect all SuiteScript 2.0 scripts?
What should be done if a SuiteScript 2.0 script validates successfully in SuiteScript 2.1?
Do SuiteScript 2.0 scripts with 'Execute As' set to 2.0 get affected by this preference?
Was this article helpful?
More in SuiteScript
- N/https Module: Binary File Support in NetSuite 2025.2
NetSuite 2026.1 adds binary file support to N/https for streamlined file handling.
- Attach and Detach Operations in NetSuite 2026.1
Attach and detach operations for record relationships in NetSuite enhance data management and connectivity.
- Create-Form Operation in NetSuite 2026.1 REST Web Services
Create-form operation in NetSuite 2026.1 APIs streamlines record creation and enhances efficiency.
- Improved Execution Log Support in NetSuite 2026.1
Improved execution log support in NetSuite 2026.1 aids debugging and performance tracking for developers.