Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Call to Script Include from report filter doesn't work

rjp
Tera Expert

Hi,

I have a very strange scenario that I'm dealing with. 

When I paste a sys_id into a report filter the row is returned without an issue...find_real_file.png

 

THis is the strange part...When I insert a call to a simple script include that returns the same Sys Id..nothing is returned.

However notice that the Sys Id is in the filter section...so the report does recognize the script include.  

find_real_file.png

 

This is my script inclulde....

find_real_file.png

I don't know if its an application problem or permission problem but I'm stuck.

THanks in advance for your attention.

RJP

1 ACCEPTED SOLUTION

Harsh Vardhan
Giga Patron

you client script prototype should be like below. 

 

var myscriptinclude = Class.create();
myscriptinclude.prototype = Object.extendsObject(AbstractAjaxProcessor, {

 

myFunctionName: function(){

 

 // write script here

},

type: 'myscriptinclude'
});

 

 

 

filter condition would be like below.

 

sys_id | is one of |javascript: new global.myscriptinclude().myFunctionName()

View solution in original post

8 REPLIES 8

Harsh Vardhan
Giga Patron

you client script prototype should be like below. 

 

var myscriptinclude = Class.create();
myscriptinclude.prototype = Object.extendsObject(AbstractAjaxProcessor, {

 

myFunctionName: function(){

 

 // write script here

},

type: 'myscriptinclude'
});

 

 

 

filter condition would be like below.

 

sys_id | is one of |javascript: new global.myscriptinclude().myFunctionName()

THank you for your quick and accurate response, it does work now that I followed your suggested convention.  However I do get this error, do you know what it means?

 

find_real_file.png

Change the the script include accessible form to all application scopes .

 

eg: go to script include , open it , you will see accessible from field , set to all application scope. 

 

Dhananjay Pawar
Kilo Sage

Hi,

Replace your filter condition with this.

javascript: new global.getInc().getInc() 

 

Your script include should be like this.

 

var getInc = Class.create();
getInc.prototype = Object.extendsObject(AbstractAjaxProcessor, {

 

getInc: function(){

 

 var sysID=<your sys ID>

return sysID;

},

type: 'getInc'
});

 

Mark correct/helpful based on impact.

Thanks,

Dhananjay.