- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2015 12:18 PM
Hello,
I am working on a script to pass information from a catalog item to CI. I have written a script and am in the process of rebuilding it to log values at various steps to see where it is not working. In the following script I am logging the values of two variables that were assigned value from the first GlideRecord and then I am trying to display the sys_id, or any value within the record, only to get null as the return for the entry. I know both GlideRecords are working as the values for tempName and tempQuestion are displaying correctly and there is the expected number of logs for the returned values of grCI, they are just returning null as the value. Here is the script that I have written:
I have tried dot-walking, grCI.sys_id or grCI.name, with the same results. If anyone could point me in the right direction it would be greatly appreciated.
Thanks,
Mike
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2015 03:58 PM
Hi Michael,
Your grCI query has a typo.
var grCI = new GlideRecord('cmdb_ci_group');
grCI.addQuery('u_catalog_cariable_name', tempName);
grCI.addQuery('u_catalog_variable_question', tempQuestion);
grCI.query();
You never issue the query. You need to add parenthesis to the call.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2015 12:25 PM
You can always try just doing gs.log(grCI.sys_id + ' Glide'); On a side note, you can also set the "Source" of the log by doing gs.log("gr sysid: " + grCI.sys_id, 'Glide');
-Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2015 03:58 PM
Hi Michael,
Your grCI query has a typo.
var grCI = new GlideRecord('cmdb_ci_group');
grCI.addQuery('u_catalog_cariable_name', tempName);
grCI.addQuery('u_catalog_variable_question', tempQuestion);
grCI.query();
You never issue the query. You need to add parenthesis to the call.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2015 06:19 AM
Hi Cory,
That would be it. Thanks for your help, I appreciate it.
Mike