Does the built-in code editor have syntax correction or highlighting?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 11:28 AM
Sometimes when writing code in SN, I'll mistype a variable name or function and I won't notice the error until after I test the script and it fails. It also takes a while to read through the code and find which line is the culprit.
I was wondering if there's syntax checking built into SN and if so how to enable it?
Thanks,
Jorge
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2024 09:41 AM
Hi @jglez1
Might be helpful
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2024 11:07 AM
Hi @jglez1 ,
We have script debuger to debug the code, you can put the break points and click on script debugger and check where the issue is coming.
Many times we write same GlideRecord with same syntax so ServiceNow provide us functionlity know as Macro Editors (syntax_editor_macro) you can define some code here and you just write the keywords and you got the code.
For example :
Here we have the code for GlideRecord so in background script we just want to write vargr (Name of Macro)
and it gives the code
And we have the code for GlideRecord as we mentioned above
You can check below links as well to debug your code
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak