List view - script include query

Ferenc Hudak
Tera Expert

Hi,

we are trying to leverage the functionality of using a script include within a list filter. For example, in SPM Project Management, if you open a Proejct list, you get the default filtering for the list as:
Task type in javascript:getValidProjectClasses()

,

in that case, getValidProjectClasses() is a script incldue that defines a simple function, which returns an array as a result. We would like to do the same, but providing an array of Sys IDs for the list, and use the filtering as some sort of access controll.
Currently we are using before queries, but running into performance issues due to the complexity of the requirements (domain separation and team spaces are not an option).

We've created a new script include, with the following function (testing purposes until now):

find_real_file.png

 

The script include is built from a copy of the original one, but we see the following result in the Project list - the result is resovled for the user, and sys ids are provided, instead of just showing the name of the Script include/function.

find_real_file.png

Is there a way to prevent ServiceNow from resolving that javascript function up there? Has anyone figured this one out yet?

 

2 REPLIES 2

Maik Skoddow
Tera Patron
Tera Patron

Hi @Ferenc Hudak 

you have to define a dynamic filter option: https://docs.servicenow.com/bundle/sandiego-platform-user-interface/page/use/using-lists/task/t_Dyna...

Maik

Hi Maik,

thanks for the input, not exactly what I'm looking for. I'm trying to understand the difference between the OOTB getValidProjectClasses() and our CapTestProjectList() script includes, as I'd like to use it as an argument for the new module under the project app menu.

find_real_file.png

 

side note, I've tried changing the order of the two filter criterias, same result... sys ids are resolved while the original argument is not.

find_real_file.png