The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Error when calling script include in filter, need help.

kenetienne
Tera Contributor

I'm attempting to call a function within a script include that returns a comma separated list of sysID's. Everytime I try to run the query I get an error in the log: 

Not allowing access to script include rhino.sandbox.TeamMembersWithITIL
Script include is not callable from the sandbox: no thrown error

and this warning

com.glide.script.RhinoEcmaError: "TeamMembersWithITIL" is not defined.
<refname> : Line(1) column(0)
==> 1: new TeamMembersWithITIL().getUserIDs();
Stack trace:
at <refname>:1

 

Table im adding the function to is sys_user and is called in the filter via this: 

sys_idINjavascript&colon;new TeamMembersWithITIL.getUserIDs();

 

The script include is in global scope, tried client callable (true/false with and without ACL), even tried using ajax processor but nothing seems to work.
I don't think the issue is the script because when I execute it from xplore via the below command, it works.

var itil = new TeamMembersWithITIL();
gs.print(itil.getUserIDs());

 What is blocking me from using this?

3 REPLIES 3

Anand2799
Giga Guru

Hi @kenetienne ,

 

Try this:

javascript&colon; 'sys_idIN'+ new TeamMembersWithITIL().getUserIDs();

 

Thanks

Anand

pavani_paluri
Giga Guru

Hi @kenetienne ,

 

If your goal is to filter a user reference field to only show ITIL users:

Go to the dictionary entry for the reference field.

Set the reference qualifier to:

roles.name=itil.

 

Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Pavani P

nkarunakar13092
Tera Contributor

@kenetienne   Since you mentioned script include is in global scope can you try calling by adding new global.TeamMemebersWithITIL().getUserIDs().

 

Try using this format: javascript&colon; "sys_IdIN" +new global.TeamMemebersWithITIL().getUserIDs().