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.
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
- Common SuiteScript Errors and Solutions for NetSuite
Common NetSuite script errors include INVALID_SCRIPT_DEPLOYMENT_ID and SSS_AUTHORIZATION_HEADER_NOT_ALLOWED. Learn effective solutions.
- SuiteScript 2.1 Enhancements and API Updates in NetSuite
SuiteScript 2.1 enables execution of 2.0 scripts and supports PATCH method for enhanced API capabilities.
- Enhancements to SuiteScript User Role Context Clarification
SuiteScript updates clarify the user and role contexts for script executions, improving deployment understanding and management.
- Setting Field Values in SuiteScript for Effective Record
Learn to set field values in SuiteScript effectively, troubleshooting common errors and understanding data types.
Advertising
Reach SuiteScript Professionals
Put your product in front of NetSuite experts who work with SuiteScript every day.
Sponsor This Category