- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2017 04:18 AM
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
i have written a script include like
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
Regards
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2017 09:55 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2017 04:37 AM
It won't work in this way, URL from argument expects a filter to be returned.
So, sysparm_query=javascript:getSomething() will not call any script include, because there is not filter after query. The correct format would've been:
sysparm_query=assignment_group=javascript:getMyGroups()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2017 08:17 AM
Thanks Anurag for your time. I want to filter on a custom field. Is there a way that instead of filtering on assignmnet_group and using the OOTB method of getMyGroups as @Robbie mentioned, i can filter on a custom reference field. That is why i created the scrip include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2017 08:29 AM
sorry there were some typos in the screen shot i have removed them. Please have a look
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2017 04:38 AM
Hi,
If you're trying to return a list of all 'honey jar' records (u_honey_jar table), I would simply change the following:
Link Type field: List of Records
Add the following Filter Conditions:
Under the -- choose field -- option select 'Active' is true
also choose 'Assignment group' is for the operator and in the reference field use the following out of the box method javascript:getMyGroups()
This will return all records that are active for the logged in user group membership