logo

NJP

No need to remember the code syntax anymore...Use Syntax editor macros

Import · Oct 18, 2021 · article

As most of us know that we write code that are repeatable and also its quite tough to remember the syntax for few of them. Especially syntax for GlideAjax seems to be difficult.

What if some one says like 'BoilerPlate templates' used in HTML you can have the fixed syntax of the code saved in your instance and when you want to recall it just call it with the shortname you define. Just like ((html+tab) to call basic html syntax.

Same is possible in Servicenow using Syntax Editor Macros, (System Definition-> Syntax Editor Macros)

Save your code give the name in syntax editor and you can recall it with 'name +tab',

Example of OOB macro,

image

If you go to business rule ,

image

Type vargr and press TAB, you will find whole syntax copied as it is in macro,

image

Using 'Syntax Macro Editor' you can save your time and also save yourself from remembering syntax. Not to forget how the small syntax error can ruin your whole day.

Happy Coding

Mihir Rathod.

View original source

https://www.servicenow.com/community/developer-articles/no-need-to-remember-the-code-syntax-anymore-use-syntax-editor/ta-p/2312745