The CreatorCon Call for Content is officially open! Get started here.

GlideRecord is undefined in Script Include

jbrooks
Mega Contributor

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?

1 ACCEPTED SOLUTION

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.


View solution in original post

11 REPLIES 11

Wait, I don't know if you are on Fuji but isn't there a setting on custom tables that allows or denies access to the table via GlideRecords?


jbrooks
Mega Contributor

Kenneth Pruitt, yep. As I mentioned, I'm using Fuji. Can you tell me more about this setting?


Ha, my apologies, i clearly didn't re-read your initial post. But 'twas a false alarm anyway. The setting I was thinking of was "Allow access to this table via web services" setting on the table record.


Michael Fry1
Kilo Patron

When you created the new table, did it automatically create ACL(s) for that table? Maybe you need to inactivate those and try it.


Gotcha. Yes, it created an ACL. So, to be clear, in the example here, the 'Create Access Controls' checkbox is marked:


acl screenshot.png



I have unchecked that and tried again, but I'm still seeing 'undefined' when I run the above code.