Syntax Editor Macros
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2025 12:27 AM
I want to know various macros other than existing
1 REPLY 1
Community Alums
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2025 06:24 AM
Hi @Ramakrishna Rao ,
Script macros provide shortcuts for typing commonly used code. To insert macro text into a script field, enter the macro keyword followed by the Tab.
- vargr
-
- Inserts a standard GlideRecord query for a single value.
- Output:
var now_GR = new GlideRecord(""); gr.addQuery("name", "value"); gr.query(); if (gr.next()) { }
- vargror
-
- Inserts a GlideRecord query for two values with an
OR
condition. - Output:
var now_GR = new GlideRecord(''); var qc = gr.addQuery('field', 'value1'); qc.addOrCondition('field', 'value2'); gr.query(); while (gr.next()) { }
- Inserts a GlideRecord query for two values with an
- for
-
- Inserts a standard recursive loop with an array.
- Output:
for (var i=0; i< myArray.length; i++) { //myArray[i]; }
- info
-
- Inserts a GlideSystem information message.
- Output:
gs.addInfoMessage("");
- method
-
- Inserts a blank JavaScript function template.
- Output:
/*_________________________________________________________________ * Description: * Parameters: * Returns: ________________________________________________________________*/ : function() { },
- doc
-
- Inserts a comment block for describing a function or parameters.
- Output:
/** * Description: * Parameters: * Returns: */