October 14, 2020

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

March 3, 2021

Does the physical location of a competent employee change the amount of value they can deliver for your organization? If it does, I’d be keen to hear your story. If it does not, why ...

Read More

March 2, 2021

Today a friend and former colleague of mine – who happens to now be in a development leadership role for a NetSuite partner – was lamenting the extreme difficulty of finding and hiring NetSuite ...

Read More

March 1, 2021

Software is never finished; clients are always changing and re-prioritizing. NetSuite is ever a moving target – always updating and evolving. Market forces are always shifting and shoving, forcing new demands on your business. ...

Read More