com.glide.script.RhinoEcmaError: "action" is not defined.

Rob37
Tera Contributor

Hello Everyone,

 

we have a bug that when someone clicks the new ui action on a related list it just redirects them back to the same form. nothing from a configuration has changed and this has just recently been acting up.

 

this is the script on the ui action

var uri = action.getGlideURI();
var path = uri.getFileFromPath() + '';
path = path.substring(0, path.length - 5) + '.do';
uri.set('sys_id', '-1');

var query = new sn_grc.GRCUtils().generateNewIssue(parent);
uri.set('sysparm_query', query);

path = new sn_grc.GRCURIUtils().checkWizard(uri, path);
if (path)
action.setRedirectURL(uri.toString(path));

action.setNoPop(true);

1 ACCEPTED SOLUTION

Laszlo Balla
ServiceNow Employee
ServiceNow Employee

Ah wait, is this script include callable from all scopes, and if not, is your UI action in the same scope as the script include?

View solution in original post

5 REPLIES 5

Laszlo Balla
ServiceNow Employee
ServiceNow Employee

Is it possible that you have the 'Client' checkbox ticked on the UI Action, but there is no Onclick function defined?

Is it possible that Client checkbox is ticked, but the code in the script field is server side (or the other way around)?

 

This is where I would start. Screenshot, perhaps?

the client box isnt checked but when i run the script debugger it doesent get past the first line of code. i will attach a screen shot of both.

Laszlo Balla
ServiceNow Employee
ServiceNow Employee

Strange as I don't see anything wrong with the screenshot. What does the debugger say? Same error?

it actually stops at line 6 when it trys to call the script include