How to get logged in users time zone in scoped app?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2015 04:25 AM
Hi All,
We used to get logged in users time zone by "gs.getUser().getTZ();"
But in scoped app, we get "Evaluator: org.mozilla.javascript.EcmaError: undefined is not a function." error while using the above code.
Is there any alternative for getTZ()?
Thanks,
Priya
- Labels:
-
Scoped App Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2015 07:59 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2015 07:54 PM
gs.getTimeZoneName();
Scoped GlideSystem API Reference - ServiceNow Wiki
A different mindset is required when writing Scoped Applications.
The API is quite different.
Recommend bookmarking below
List of Scoped Scriptable Objects - ServiceNow Wiki
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2015 02:25 AM
Hi Paul\Kalai,
Still getting the same Ecma error, when using the "gs.info(gs.getTimeZoneName());" which comes under the scoped API as you guys mentioned.
Thanks,
Priya

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2015 02:36 AM
Can you verify if any other gs functions as working ? Like gs.getUserID()?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2015 02:43 AM
Yes other gs functions works as expected in scoped app except getTimeZoneName().
I think we have to raise this issue in HI portal..
Thanks,
Priya