Getting com.glide.script.RhinoEcmaError: undefined is not a function on an out of the box widget

kemmy1
Tera Guru

I have a page, Data Table from Instance Definition widget and the filter on the widget is on a reference field "is" javascript: new x_g_dh5_dfas_ext.dfasUtils().getUserFacility(gs.getUser().getEmail());.  

 

The script include "dfasUitls()", page, and widget are all from Scope A, and the getUserFacility function is calling a table to get info from Scope B.  

 

When I impersonate my user, go to the page, I'm not getting any data back.  The filter is: All > Approval State not in (Reject, Waiting for Approval) > Appointment Location = (empty). 

 

It's not getting the data and I'm getting this in the system logs:

com.glide.script.RhinoEcmaError: undefined is not a function.
<refname> : Line(1) column(0)
==> 1: new x_g_dh5_dfas_ext.dfasUtils().getUserFacility(gs.getUser().getEmail());

 

I tested this out by creating a business rule in Scope A and adding this script (on update) to a Scope A table and kicked this off:

var facility = new x_g_dh5_dfas_ext.dfasUtils().getUserFacility(gs.getUser().getEmail()); 

gs.info(facility);

I impersonate the user and get the correct facility in the system logs.  So it's not a cross scope issue right?

 

I've tried creating the script include in Scope B. (the same scope that we are trying to get the data from) and still get this issue.

 

Does anyone know what this error means?

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@kemmy1 

seems you are not able to access the script include from other scope?

it simply means it doesn't know where is this function defined -> getUserFacility

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@kemmy1 

seems you are not able to access the script include from other scope?

it simply means it doesn't know where is this function defined -> getUserFacility

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thank you so much!  My script include was not a client callable, so that was the issue.  And that's exactly what it was trying to tell me.