SuiteScript 2.1 Limitations

After a couple of SuiteScript 2.1 emails, some helpful readers have pointed out some limitations and asked some questions. While the addition of new and powerful syntax is excellent and very much worth your time to explore, there are limitations to the support NetSuite offers.

First, according the the SuiteScript 2.1 Help page, NetSuite supports JavaScript up to version ES2019. Anything after that will not (yet) be supported in server-side JavaScript.

Second, Client Scripts do not support the version 2.1 tag. The validator will complain if you upload a Client Script source file tagged as 2.1. That said, because most browsers support the latest JavaScript syntax, you can still take advantage of the latest syntax and “work around” NetSuite’s validation by tagging your Client Script as 2.x instead.

Reader Anon E Moose points out that the Debugger does not support 2.1 (shared with permission, name obscured by request) :

“I’m surprised that you are promoting 2.1 emails. I believe that NS still has not exposed 2.1 to the debugger that makes unusable from my point of view.”

Great point! If you are an avid user of NetSuite’s debugger environment, then 2.1 will not be viable for you. I have never been a Debugger developer myself, but if you are, be aware of this limitation.

Reader Clay Roper points out a bit more nuance:

“Quick question re optional chaining – are you able to get this to work in server SS2.1? My understanding is that Graal VM runs ES2019, so this (and features like nullish coalescing) aren’t available there just yet.”

[Quick note: GraalVM is the engine NetSuite uses to run SuiteScript 2.1 (as opposed to SuiteScript 1.0 and 2.0 which run on the Rhino engine).]

Yet another great point disguised as a question. According to the SuiteScript 2.1 Help page, Clay is correct that NetSuite only supports up to ES2019, which does not include my Optional ChainingNullish Coalescing, and some other very cool features. That said, you can still take advantage of these in Client Scripts (the previous caveat still withstanding) because nearly all major browsers support a much newer standard than does NetSuite’s server side.

Thanks for keeping me in line, everyone!

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Related posts

January 7, 2021

Anything I wrote today about business would both feel and be inadequate. I simply can’t arrive at the words to express how I feel in this moment. So instead, here are a few helpful ...

Read More

December 20, 2020

2020 was a hundred swift kicks to the shorts and one giant kick in the ass. If you’ve lost people you love, if you’ve gotten sick or hurt, if you’ve lost your job, if ...

Read More

December 16, 2020

“I’ve been meaning to learn SuiteScript, but it’s hard to find the time …”“We’re slammed, and I just don’t have the time …”“I haven’t made the time …” All are variations of a theme ...

Read More

December 14, 2020

Last week we looked at mimicking the functionality of a REST endpoint with its own module (e.g. retrieving a User, or a list of Users, refreshing a token, etc). For complex integrations that rely on a large ...

Read More