Call script include to a Reference field in a variable set

ServNowDev
Tera Guru

I have a Business Service Field i want to filter using a call to a script include. Yes this could be done user simple but this is a small sample to a bigger issue. Im having issues calling to a script include from a reference qualifer variable in a variable set. Works fine if it was a field on a form. 

 

Screenshot 2025-09-07 at 2.03.55 AM.png

4 REPLIES 4

SN_Learn
Kilo Patron
Kilo Patron

Hi @ServNowDev ,

Your Script Include's code is not client callable:

SN_Learn_3-1757229423341.png

 

It should be like below:

SN_Learn_4-1757229463723.png

 



Please check the below working script:

SN_Learn_0-1757229153777.png

 

SN_Learn_1-1757229194317.png

 

SN_Learn_2-1757229235951.png

 

 

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

RaghavSh
Kilo Patron

@ServNowDev your script include is not client callable, so probably what went wrong here is that you created the script include and checked the "client callable" later or you deleted the client callable script include syntax, maybe by mistake.

 

Client callable script include syntax, calls the abstract class, so simplest fix here is to delete this SI and create a new script include with client callable checked (syntax will auto appear) and then write your function.

 

Note: Client callable SI will prompt you to add role to that, which will create a client callable script include ACL in backend, you can add the role as per your need (only that role will be able to execute this SI).


Raghav
MVP 2023

@ServNowDev Were you able to get this fixed.


Raghav
MVP 2023

Rafael Batistot
Tera Sage

Hi @ServNowDev 

 


if you want to mark “client callable” I recommend use glideAjax in catalog client script 


https://www.servicenow.com/community/developer-articles/glideajax-example-cheat-sheet/ta-p/2312430

 

If not, unchecked this box and in your script include, may you try

 

getTest: function() {
return 'active=true;
}