- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-06-2015 03:46 PM
Hi! I'm on Fuji, trying to access data from a custom table to use in a scheduled job, and I keep getting the following in my system log:
org.mozilla.javascript.EcmaError: "user_credentials" is not defined.
Caused by error in <refname> at line 6
3: function pollNetScaler() {
4: gs.log('Start poll');
5: var user_credentials = new GlideRecord('u_custom_credentials');
==> 6: user_credentials.query();
I replaced my custom table with a vanilla system table- sys_user- but got the same result. I'm running the scheduled job a myself (and I have the admin role). What might I be missing here? How can I access table data?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2015 11:04 AM
I do see them, yes! And that line gives me the object type of netscale_use- which I see was from a previous iteration of this script, and I see that I DID make a typo in my variables previously, which leads to this. Auuugh! I'm a fool.
Thanks, everyone, for your responses! It helped me look at this in a bunch of different, helpful ways.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-06-2015 05:55 PM
Maybe try using a different variable name like userCredentials
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2015 05:36 AM
user_credentials is actually an example name; I used a different name in the actual script, and it did not work. This does not appear to be a namespace collision for that name.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-06-2015 09:44 PM
Hi John,
Can you please paste the completed script here so that we can debug further.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2015 06:14 AM
pollRestDevice();
function pollRestDevice() {
gs.log('Start poll','BROOKS');
var user_credentials = new GlideRecord('u_custom_credentials');
user_credentials.query(); // <-- script errors out here.
user_credentials.next();
gs.log("made a gliderecord, type " + typeof netscale_user,"BROOKS");
var query = new restDeviceQuery(); <-- this is a script include that runs without issue.
gs.log("Begin query","BROOKS");
query.queryAppliance();
}
This is my script!