- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2024 06:13 AM - edited 08-19-2024 06:16 AM
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2024 07:27 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2024 07:27 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2024 10:50 AM
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.