Changing Javascript Mode on an existing Application

Bharath K B3
Tera Contributor

I want to change the Javascript mode to ECMAScropt 2021 (ES12) on an existing application. The applicaiton was on ES5 Standards mode till now.
I wanted to know if changing this will affect the existing code in the system. 

Thank you!

1 REPLY 1

Tanushree Maiti
Tera Patron

Hi @Bharath K B3 

 

1.  Refer: https://www.servicenow.com/docs/r/api-reference/scripts/set-javascript-mode-application.html

Procedure

  1. In the application navigator, enter sys_app.list.
  2. Select an application.
  3. In the JavaScript Mode field, select the mode to use.
    • ECMAScript 2021 (ES12): Supports a subset of ECMAScript 2021 (ES12) and ECMAScript 2022 (ES13) syntax and features.
    • ES5 Standards Mode: Supports ECMAScript5 syntax and features.
    • Compatibility Mode: Used for all scripts developed prior to the addition of ES5 Standards mode.
  4. Select Update.

 

2. Turn Off this per script include . Refer: https://www.servicenow.com/docs/r/xanadu/api-reference/scripts/set-es12-mode-scripts.html

  1. Navigate to a form with a script field.
    For example, to open a script include form, navigate to All > System Definition > Script Includes or enter sys_script_include.list in the navigation filter.
  2. Select an existing script 
  3. Turn off ECMAScropt 2021 (ES12)

 

TanushreeMaiti_0-1780461621076.png

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti