Global system script includes not available from scopes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2015 10:02 AM
There are many system provided script includes that are not accessible from custom scopes. Even though they are in the global scope they are blocked because the "accessible from" value is set to "this scope only". This is going to create a huge issue and drive everyone to make a lot of changes to system scripts.
First ones I came across were commonly used, JSUtil and TableUtils.
Changing the "accessible from" resolves the issue. Platform wide system scripts should be set to be available in all scopes or just not have the setting apply if scope is global.
"Illegal access to private script include TableUtils in scope rhino.global being called from scope x_...."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2015 07:47 PM
Hi John,
The legacy global TableUtils is not a valid api, and ServiceNow provided a one in the scoping world - GlideTableHierarchy. JSUtil in general isn't needed. You can use gs.nil and JSON.encode/decode instead.
ServiceNow introduced public and private APIs, and the platform has only exposed a few public script include APIs as part of that. Scoping apis will not leak java objects, and lots of the old script includes leaked/dealt with java objects so they just aren't valid. If you are facing a problem with other global script include, please let us know.
Thanks,
Prashant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2015 07:57 AM
Thanks for getting back to us Prashant. Can you make sure to get this page updated: JSUtil - ServiceNow Wiki so that it notes this should only be used in global scope or not used at all?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2015 08:32 AM
Hello Prashant, I would also recommend that we make JSUtil available to developers. This library has many handy utilities including doing a log dump of an object. This is very helpful in debugging. Are there any security or platform concerns with leaving this library open to the public?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2015 09:21 AM
John, I agree with you, JSUtil does have some useful things in it.
Maybe someone can enlighten me as to why these items are not available to scoped apps? It seems a silly limitation as it is so easily circumvented.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2016 03:25 PM
Very helpful, thank you! I just finally got my main focus away from Eureka -- now on Istanbul, I was running into a not found error for JSONParser from a non-global scope. Thank you for cluing me in to the proper exposure of the JSON object; instead of using JSONParser.parse(), I can now simply use JSON.parse() from any scope.