- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2019 07:49 AM
I'm trying to figure out the correct syntax for referencing the variable sys_id as the second parameter of the addQuery function. The sys_id is alphanumeric so it needs to have quotes around it. Here's what I've got, but it doesn't work.
<g:evaluate>
var sys_id = "'" + RP.getParameterValue("sys_id") + "'";
var nav = new GlideRecord("u_step_content");
nav.addQuery("u_parent", sys_id );
nav.query();
</g:evaluate>
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2019 08:48 AM
Try this
<g:evaluate>
var sys_id = "'" + RP.getParameterValue('sys_id') + "'";
var nav = new GlideRecord('u_step_content');
nav.addQuery('u_parent', sys_id );
nav.query();
</g:evaluate>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2019 08:48 AM
Try this
<g:evaluate>
var sys_id = "'" + RP.getParameterValue('sys_id') + "'";
var nav = new GlideRecord('u_step_content');
nav.addQuery('u_parent', sys_id );
nav.query();
</g:evaluate>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2019 09:39 AM
Thanks. That worked. I guess I was overthinking it.