- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 04-30-2020 11:47 PM
Definitions:
The Syntax Editor(SE) is a ServiceNow built-in text editor. It offers the following features as you script:
- Automatic Javascript syntax coloring, auto-indentation, line numbers, and creation of closing braces and quotes.
- Code Editing functions
- Context-sensitive Help
- Syntax Error Checking
- Editor Macros for typing commonly used code
Color Coding:
As a developer, we understand the importance of color-coding. It enhances the code reading experience. So, in SE we have following color codes:
- Blue for strings or reserved keywords(can't choose it as a variable name)
- Purple for Javascript commands(tells the platform what to do)
- Green comments(Comments help you or other people understand code better)
- Bold text indicates the context menu item.
See the color codes in the example.
Braces and Quotes:
As we type the code in SE, the closing parenthesis, braces or quote are automatically inserted and you can also check the matching character while placing the cursor beside the parenthesis, braces or quote.
Context-Sensitive Help
While editing a script, Context-Sensitive Help can be invoked by using the CTRL+ Space (both Mac/Windows) or a .(period)
Note: Suggestions are context-sensitive relative to the cursor's current position and are filtered based on API type. So if you are working on a server-side script like BR you will see suggestions from server-side APIs only.
Properties assigned to a locally declared object are also included in the suggestions for example:
If I have an object called car that has attributes like the model, capacity, make, so when I type car. I will get the attributes in the suggestion.
Context Menu Options:
In the syntax editor, bold font is used for tokens that have a context menu. Right-click the token to view context menu options. If you use a Mac, you can use the Command-click shortcut.
Code Editing Functions:
SE toolbar provides standard JavaScript code editing functions:
Just explore each one of them and trust me once you are habitual of using these tricks you will certainly have better efficiency.
REQUEST:
If you find the article helpful, please mark the article as helpful, and since it has lots of useful links do remember to bookmark this article.
In case you need any help, please do connect with me. It will be my pleasure to help you.
Happy Learning Guys!!!
----->Dhruv Gupta
- 1,908 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Great Article
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Informative 🙂
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
ANother great article. Bro you are doing some amazing stuffs
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Excellent article. Thank you.