If you’re reading this, chances are you’re wondering about the recent email from NetSuite regarding an upcoming change in the behavior of some scripts and what it means for you. As a NetSuite Solution Provider, our first priority is to keep our client’s businesses running smoothly. Here we break down what it all means and answer some of the most frequently asked questions regarding NetSuite’s SuiteScript 2x annotated server scripts change.
What happens if you do nothing?
Odds are good that you’ll be fine, at least in the short term. NetSuite’s upgrade is not meant to remove any functionality, but some very minor behavior will be tweaked. In the years to come, more substantial changes might introduce greater risk.
What can I do to eliminate any risk?
This is easy! Just navigate to Setup > Company > General Preferences and find the one for “Execute SuiteScript 2.X Scripts As.” If you select “2.0” then nothing changes.
This does not mean you should skip any Release Preview testing! Every release comes with the potential to break custom processes, and you should always take advantage of the free Release Preview environment when they become available.
Do I need to have my scripts updated?
No. As long as the above preference is set for your account, you don’t need to worry.
If you are a 360 Cloud Solutions client and we have to create new scripts or edit existing scripts as part of a project or request, we’ll be testing them and locking them into a specific SuiteScript version to prevent any future issues.
Didn’t I see something about this before?
Yes! If you are one of 360’s clients, you likely got an email from us in October 2019 with the subject “NetSuite Backwards Compatibility for 2.X SuiteScripting,” inviting you to send us a screenshot of your RESTlet script list. If you did that, we checked your scripts and advised you on next steps.
What are the technical details of the SuiteScript 2x Annotated Server Scripts change?
So glad you asked! The information below should satisfy your curiosity about what is actually happening here, and give you some resources to do some further research yourself.
In the early days of SuiteScript 2.0 (circa 2015.1), script adoption, many code editors, and sample code snippets included the declaration of 2.x at the top of SuiteScript files, which directs NetSuite as to which scripting engine to leverage when executing the script. As NetSuite transitions to the next version, which is SuiteScript 2.1, any scripts declared 2.x would effectively run leveraging the 2.1 scripting engine. While the article does assure backward compatibility for 2.x defined scripts, NetSuite also exposed a relatively new preference, which allows the account owner to set the scripting engine to be used when encountering 2.x scripts.
From what we have seen at 360 Cloud Solutions, NetSuite already establishes 2.0 as the default scripting engine preference when scripts are defined as 2.x. Our recommendation would be to review and become familiar with the script preference setting under Setup > Company > General Preferences and review the field “Run SuiteScript 2.x server script as” = SuiteScript 2.0.
In our review of the related SuiteAnswers ID 86967, 87299, 91600, and 91317, we found the following:
- At the time of this writing, NetSuite has not advertised any real benefit in running a legacy 2.x in 2.1 as the previously authored scripts would not contain any syntax leveraging the new specs referenced in SuiteAnswer 86967.
- If newly written scripts require 2.1 features, then 2.1 may be declared on a script by script basis as referenced in SuiteAnswer 87299.
- NetSuite provides a simplified method to force all 2.x scripts to execute under the 2.0 script engine, as referenced in SuiteAnswer 91600.
- NetSuite does not disclose any benefits in running legacy scripts 2.x script under the newer script engine. Reference SuiteAnswer 91317.
Access SuiteAnswers by logging into your NetSuite account and selecting SuiteAnswers from the Support tab.
In summation, leveraging the “Run SuiteScript 2.x server script as” is the best solution at this time. As always, there is the potential that NetSuite completely depreciates 2.0 scripts at some point in the future; however, we would expect ample warning from NetSuite before a change of this magnitude would occur.
An alternative would be to have 360 Cloud Solutions audit and update all scripts to declare 2.0 explicitly, which in itself may introduce additional scripting errors and potential refactor beyond the script version declaration. If we can help with this, submit a support request to get started!