Script include not being called from module filter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2023 01:06 PM - edited ‎04-06-2023 01:09 PM
Hey guys, I have a module where I'm calling a script include (client callable is checked), however it doesn't seem like the script is being called. The module is in a scoped application while the script include is global. I know the script include works because I have tested it in Background scripts. I've tried so many different ways of calling the script include, but nothing seems to be working.
Here is the module filter:
And here is the script include. The gs.info on line 33 isn't even logging, so it seems like the script include is being called at all.
Any help is appreciate. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2023 02:07 PM
You may need to add the sys_ids as a comma-separated string instead of an array object since multiple are coming back.
Take a look at this discussion: https://www.servicenow.com/community/developer-forum/script-include-to-filter-module-list-view-not-b...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2023 02:23 PM - edited ‎04-06-2023 02:23 PM
This makes sense but I just tried this and still nothing. For the sake of testing, I just tried hardcoding two sys_ids as a comma separated string into the return statement, and I'm still not getting anything. The gs.info I have in my code isn't showing up in the logs, so it seems like it's not even reaching the return statement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2023 02:45 PM
It looks like gs.info() may not show up when the script is called from a filter. Check out this KB: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0752278
If your script include is simply this, does it work? Wanting to try and rule out if the filter is actually calling the SI or not.
var getControlObjectives = Class.create();
getControlObjectives.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getControlObjectives: function() {
return '<hardcoded_sys_id>'
},
type: 'getControlObjectives'
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2023 09:47 AM
No, this isn't working either
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2025 10:55 AM
I'm having the same problem. It's just showing NULL.