- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2022 10:08 AM
Hello Community,
Can anyone let us know can gs.now() will work scoped applications?
Thanks,
Nagesh
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2022 10:22 AM
No it will not work in scoped applications.
The best way to use in scoped applications is using new GlideDateTime();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2022 10:14 AM
Hi,
Just checked on Developer site, no, it's not supported in scoped applications.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2022 10:24 AM
You can easily try something like this yourself by running the method in Scripts Background,
and just switch to a scoped application.
By just running
var test = gs.now();
You will get the following output.
Evaluator.evaluateString() problem:
com.glide.script.fencing.MethodNotAllowedException:
Function now is not allowed in scope x_xyz_scopename.
Use GlideDate instead: new GlideDate().getDisplayValue():
com.glide.script.fencing.ScopedScriptableObject.checkWhitelistAccess(ScopedScriptableObject.java:137)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2022 10:17 AM
Hi,
As
You can use the - new GlideDateTime().getDisplayValue();
Thanks
Chandu Telu
Please Mark ✅ Correct/helpful, if applicable,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2022 10:22 AM
No it will not work in scoped applications.
The best way to use in scoped applications is using new GlideDateTime();