- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2018 06:25 AM
Need some help here,
For reporting purposes, we have created a database view in the sn_hr_core scope to join the tables task_sla and hr_core_case_workforce_admin.
Here is a screenshot of the database view:
The database view is working fine but when we try to build a report, we get the following error:
Function getSysTimeZone is not allowed in scope sn_hr_core
How do I fix this?
This is not only the case for the HR scope, but for all scoped applications with a database view using task_sla
(I have tested this on my developer instance)
Solved! Go to Solution.
- Labels:
-
Reporting

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2018 06:39 AM
I don't think you can fix this directly. It's built in to 4 script includes and 3 business rules that call gs.getSysTimeZone(). The development team either needs to make that function available to scoped apps or create a scoped equiv. and update those 7 files.
I invite you to open an enhancement request! Our product managers DO listen.
Enhancement requests: Tell us how you would improve the ServiceNow product
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2018 02:22 PM
I'm using a scoped app on the London release. I just created an indicator source using a view as the fact table. The initial save went fine, but when I open the indicator source then return to the list of sources I get this error in the heading.
What is the impact of this error?
Can I use my new source?
Is there a workaround?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2018 04:01 AM
The workaround is to make a script include in global that calls the function you need (e.g. gs.getSysTimeZone()) and make that script include available to all scopes. You can then call it from your scoped app. It's a bit of a hack and this script include will not be part of your scoped app so you'll have to maintain it separately. Note, none of this code has been tested. Example:
var myGlobalUtils = Class.create();
myGlobalUtils.prototype = {
initialize: function() {
},
getSysTimeZone : function() {
return gs.getSysTimeZone();
},
type: 'myGlobalUtils'
};
Then you call global.myGlobalUtils().mygetSysTimeZone() from your scoped app and get the result you want.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2018 04:09 AM
The workaround is to make a script include in global that calls the function you need (e.g. gs.getSysTimeZone()) and make that script include available to all scopes. You can then call it from your scoped app. It's a bit of a hack and this script include will not be part of your scoped app so you'll have to maintain it separately. Note, none of this code has been tested. Example:
var myGlobalUtils = Class.create();
myGlobalUtils.prototype = {
initialize: function() {
},
getSysTimeZone : function() {
return gs.getSysTimeZone();
},
type: 'myGlobalUtils'
};
Then you call global.myGlobalUtils().mygetSysTimeZone() from your scoped app and get the result you want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2018 12:36 PM
Thanks Chuck - to be clear, I don't explicitly call getSysTimeZone. In my new indicator source I have a condition checking a specific date against a datetime field in the database view. Do you think your work around still applies? If so, how would I use call it in the condition builder?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2018 06:31 AM
While my PA knowledge isn't that great, if there's a place to call this function, you can call the workaround one from the script include in the same way.