Script include not being called from module filter

Farah5
Tera Contributor

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: 

Farah5_0-1680811476040.png

 

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. 

Farah5_1-1680811576017.png

Any help is appreciate. Thanks

9 REPLIES 9

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... 

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. 

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'
});

 

No, this isn't working either

JasonE
Tera Contributor

I'm having the same problem. It's just showing NULL.