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.

·2 min read·6 views·View Oracle Docs

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:

  1. Navigate to Setup > Company > General Preferences.
  2. 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?
To enable this feature, go to Setup > Company > General Preferences and check the box for 'Execute SuiteScript 2.0 Server Scripts as 2.1'.
Will enabling this preference affect all SuiteScript 2.0 scripts?
No, only SuiteScript 2.0 server scripts that successfully validate will run in the SuiteScript 2.1 environment. Those that do not will continue executing under SuiteScript 2.0.
What should be done if a SuiteScript 2.0 script validates successfully in SuiteScript 2.1?
If a script validates successfully, it is recommended to update the script's annotation to take advantage of SuiteScript 2.1’s enhanced features, such as those derived from the Graal runtime engine.
Do SuiteScript 2.0 scripts with 'Execute As' set to 2.0 get affected by this preference?
No, scripts with the 'Execute As' field set to 2.0 will not be affected and will continue to run as SuiteScript 2.0.
Source: New Preference to Execute SuiteScript 2.0 Scripts as SuiteScript 2.1 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 →