Script Include To Filter Module List View Not Being Called

thisisauniqueus
Giga Expert

Hi

I have an issue. I have created a new module called Honey Jars and in the module link type i have selected URL(from arguments). In the arguments i am calling a script include like

find_real_file.png

i have written a script include like

find_real_file.png

now the issue is this script include is not getting called as the event is never logged. Can any one please help me solve this issue. Basically i want to filter the list view based on the logged in user group membership.

The list shows a filter like

find_real_file.png

Regards

1 ACCEPTED SOLUTION

Patrick Schult2
Giga Guru

John, you can indeed do this. The important thing to remember is that the only thing your script include should RETURN is a string for what you want to put into the query.



For example, if your arguments are "u_honey_jars_list.do?sysparm_query=u_contract=javascript:getSomething()&sysparm_view=", then your script include should return a string value of whatever u_contract should be. The way it's written here, with an equals sign after u_contract, you need to return a SINGLE sys_id to it. If you return multiple, it won't work. If you were wanting to return multiple sys_ids to it, return a comma separated string, not an array object.



As proof it will work, see the attached screenshots.


View solution in original post

15 REPLIES 15

Thank you Robbie for taking some time and answering the question. Im aware of the OOTB method but is there a way that i can call my custom method and filter the list of record based on a custom reference field?



Regards


sorry there were some typos in the screen shot i have removed them. Please have a look



Regards


thisisauniqueus
Giga Expert

if you want i can provide access to the personal dev instance


Patrick Schult2
Giga Guru

John, you can indeed do this. The important thing to remember is that the only thing your script include should RETURN is a string for what you want to put into the query.



For example, if your arguments are "u_honey_jars_list.do?sysparm_query=u_contract=javascript:getSomething()&sysparm_view=", then your script include should return a string value of whatever u_contract should be. The way it's written here, with an equals sign after u_contract, you need to return a SINGLE sys_id to it. If you return multiple, it won't work. If you were wanting to return multiple sys_ids to it, return a comma separated string, not an array object.



As proof it will work, see the attached screenshots.


Patrick i really appreciate your help. I got it working by making the name of script include all small letters. Weird i guess but now it works.



find_real_file.png



Best Regards