Oracle NetSuite
  • Industries
    • Overview
    • Advertising Media and Publishing Industry
    • Manufacturing Industry
    • Nonprofit Industry
    • Professional Services & Support
    • Restaurant Industry
    • Retail Industry
    • Services Industry
    • Software Industry
    • Wholesale Distribution Industry
  • Global Region
    • Overview
    • APAC
    • EMEA
    • Japan
  • Product
    • Overview
    • CRM
    • ERP / Accounting
    • Ecommerce
    • Financials
    • HCM
    • Platform
    • PSA
  • Topic Category
    • Overview
    • Cloud
    • Enterprise
    • General Business
    • Guest Posts
    • Industry Trends
    • Partners
    • Social Impact
  • The NetSuite Podcast
  • Visit the NetSuite Site
  • About This Blog
  • Contact Us
Share to Facebook Share to Twitter Share to LinkedIn Share to LinkedIn
Oracle NetSuite Blog

SuiteScript 2.1 Delivers Modern JavaScript Syntax for Server-Side Development

By Ashwin Krishnamurthy
, Senior Product Manager, SuiteCloud Platform
Monday, June 1, 2020

SuiteScript 2.1, the latest enhancement to NetSuite’s scripting tool, represents a giant step towards NetSuite’s goal of conforming to the latest ECMAScript JavaScript specification. There are already significant benefits with the GraalJS runtime environment and how that gives SuiteScript developers access to the most current ECMAScript features and syntax out of the box. The SuiteScript 2.1, released in NetSuite 2020 Release 1, can help you do even more with NetSuite’s customization language. 

As the ECMAScript specification continues to evolve at a rapid pace, it improves developer productivity, such as freedom from rewriting a lot of the same code over and over. The expressivity and power offered by the latest standards make it possible to write modern server-side code using arrow functions, block-scoped variables, spread operators and more.

Let’s take a closer look at just a few of these:
 

Spread Operator & Arrow Functions

Use the spread operator (“…”) to quickly combine two objects together into a single object as shown below. Couple that with the easy-to-use arrow functions to simplify function scope.


Destructuring Assignment

Quickly unpack properties from an object into distinct variables using destructuring assignment.

For a complete overview of all ECMAScript features, please refer to the 2019 Specification.

There are a few more items that you’ll find useful. Currently, server-side scripts annotated as @NApiVersion 2.x execute as SuiteScript 2.0. As a part of this release, NetSuite has added an account-level preference giving you the flexibility to execute your server-side scripts annotated with @NApiVersion 2.x as SuiteScript 2.1. If for any reason you need to change the runtime behavior back to SuiteScript 2.0, it's as easy as flipping a switch.

These updates give you ample time to test all your server-side applications and libraries on the new engine powering SuiteScript 2.1 before rolling out to production. For more information on implementation timelines please visit the documentation page, and make sure you speak with your administrator as you plan for any changes.

Aligning SuiteScript with ECMAScript delivers enhanced developer productivity, more maintainable code and ensures ongoing conformance to an evolving standard, opening up a wide range of new possibilities for NetSuite customization. Here are a few resources to learn more:
 

  • Getting Started with SuiteScript 2.1
  • Differences between SuiteScript 2.0 and SuiteScript 2.1
  • Transition period for SuiteScript 2.x
  • Enabling SuiteScript 2.1 at an Account Level

 

NetSuite Expands Integration Capabilities with new REST Web Services

SuiteCloud SuiteTalk REST Web Services are now generally available for all Oracle NetSuite products, extending a robust set of complementary SuiteTalk...

Share to Facebook Share to Twitter Share to LinkedIn Share to LinkedIn

Products
  • ERP
  • Global Business Management
  • CRM
  • Human Capital Management
  • Professional Services Automation
  • Omnichannel Commerce
  • Email Marketing
  • Analytics
  • Business Intelligence
  • Experience
Services
  • Industry Expertise
  • Professional Services
  • Education Services
  • Support Services
  • Partner Services and Support
Partners
  • Solution Provider Program
  • Alliance Partner Program
  • Developers Overview
  • Business Process Outsourcing
  • Referrals
  • Accountants
  • Commerce Agency Program
  • Private Equity Practice
  • Venture Capital Practice
Company
  • Careers
  • Contact Us
  • Events
  • Leadership
  • Newsroom
  • Social Impact
  • Oracle Home
Resources
  • Blog
  • Data Sheets
  • Product Demo
  • Webinars
  • White Papers
United States

500 Oracle Parkway
Redwood Shores, CA 94065

  • © 2020 Oracle
  • |
  • Site Map
  • Terms of Use and Privacy
  • Careers
Products
  • ERP
  • Global Business Management
  • CRM
  • Human Capital Management
  • Professional Services Automation
  • Omnichannel Commerce
  • Email Marketing
  • Analytics
  • Business Intelligence
  • Experience
Services
  • Industry Expertise
  • Professional Services
  • Education Services
  • Support Services
  • Partner Services and Support
Partners
  • Solution Provider Program
  • Alliance Partner Program
  • Developers Overview
  • Business Process Outsourcing
  • Referrals
  • Accountants
  • Commerce Agency Program
  • Private Equity Practice
  • Venture Capital Practice
Company
  • Careers
  • Contact Us
  • Events
  • Leadership
  • Newsroom
  • Social Impact
  • Oracle Home
Resources
  • Blog
  • Data Sheets
  • Product Demo
  • Webinars
  • White Papers
United States

500 Oracle Parkway
Redwood Shores, CA 94065

  • © 2020 Oracle
  • |
  • Site Map
  • Terms of Use and Privacy
  • Careers