gs.log not working in script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2018 08:51 AM
I have a very simple script include and I can't get the gs.log to work so I'm not even sure if it's being called correctly.
Below is the script include named cab with function cabCheck.
In the report I am calling this using javascript: new cab().cabCheck() and javascript: new cab.cabCheck(). In reviewing the log files, I do not see "cab check" anywhere so I don't know if the report is actually calling my script include or if gs.log doesn't work in it or if the script include isn't set up right.
Any ideas what's not working?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2018 09:06 AM
Try using
new cab().cabCheck() instead of new cab.cabCheck()
Thanks,
Jaspal Singh
Hit Helpful or Correct on the impact of response.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2018 09:11 AM
Where did you want to call that script include? If you want to call that from scoped application then you will change accessible from field from this application to all application and try with what Patel would suggest you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2018 09:12 AM
Hi Wilber,
Is that report also in same scope?
Your script include is in global scope and if your report is in another scope then it won't work since accessible from on script include is this application scope only
Valid syntax to call in report is
javascript: new cab().cabCheck();
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2018 09:15 AM
Yes, both the report and the include are in the same global scope.
I did try javascript: new cab().cabCheck(); with and without the semi colon.
I also set Accessible From to All application scopes for the script include.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2018 09:26 AM
If its scope issue then user new global.cab().cabCheck();
Since you are using from client side, it should be client callable and the AbstractAjaxProcessor should be extended in the script include.
var cab = Class.create();
cab.prototype = Object.extendsObject(AbstractAjaxProcessor, {
cabCheck : function(){
gs.log();
},
type: 'cab'
});