Module arguments with script include

ejaram
Kilo Expert

Hello,

I'm trying to make a couple of modules accept a script include in the arguments for a List of Records to set a reference qualifier. The issue I have is I cannot seem to get the arguments to set the reference qualifier.

When I put in the script include call: javascript:u_getSelfService(argument) it will not return anything. It is a quite simple script include below:

function u_getSelfService(getACT) {

  var actIS = "active=" + getACT;

  var filterString = "";

  filterString += actIS + "^sys_class_name=sc_req_item"; //Req Item

  gs.log("FilterString is: " + filterString);

  return filterString;

}

Any ideas? Are arguments not capable of using a script include? I tried using a background script to make sure the script include is returning what it is supposed to, and it is returning what it is supposed to. After running the list of records, it is not even outputting the log statement which makes me think it is not even running the function.

The script include is client callable also.

6 REPLIES 6

Brad Tilton
ServiceNow Employee
ServiceNow Employee

What are you passing as the argument?


I am passing in "true":



javascript:u_getSelfService("true");



Inputting this into the background script also works okay.


Jim Coyne
Kilo Patron

You can only have 2 different conditions returned, so why not just setup the two different modules with the appropriate conditions in the modules themselves?   No point over engineering things.


We are going to be modifying this a lot in the near future, and it will be easier to manage in one place as opposed to multiple places.