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
‎10-16-2016 07:21 PM
Did you get any solution on this.I am also facing same issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2016 08:29 AM
prasad,
I have figured it out.
Here are the steps that I had to do to get Glide Ajax to work in a custom app (Mine is setup to be triggered by clicking a button) (Example included)
1. Create UI Action.
2. Make sure the UI action has the 'Client' check box checked
3. Put a JS method name in the 'OnClick' field of the UI Action. This is the key that turns the UI action into a client side script and makes the Gide Axjax ojbect visable
4. Make your method you put in the 'OnClick' field
5. Setup the GlideAjax object and call your script include.
6. Script include must use: (near the top of the file)
YourScriptIncludeName.prototype = { Object.extendsObject(global.AbstractAjaxProcessor
instead of:
YourScriptIncludeName.prototype = {
7. Script include cannot have a:
initialize: function() {
//some code
},
I personally made my own like this:
_init: function() {
//some code
},
somePublicMethodCalledByAjax: function() {
this._init();
//the rest of your code
},
Example UI Script Ajax call:
function isAllowedToDoSomething() {
var ajax = new GlideAjax('full path to your scoped app script include. Look in the Api Name field of the script include to find it');
ajax.addParam('sysparm_name', 'isAllowedToDoSomething); //name of the public method you want to call in your script include
ajax.getXML(parseIsAllowedToDoSomething);
}
//the response var is auto made by the system
function parseIsAllowedToDoSomething(response) {
if(response.responseXML.documentElement.getAttribute('answer') === "true") {
alert("Granted.");
} else if(response.responseXML.documentElement.getAttribute('answer') === "false") {
alert("Denied.");
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2016 08:52 AM
Thank you Travis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2016 09:23 AM
You're welcome
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2019 10:29 AM
5 years later and this is still a problem that hasn't been fixed?? How are these things "global" when they are in fact very much NOT global? How are we supposed to develop an "application" that people can download from the store if we can't actually leverage the platform?? The simplest functions are just not possible thus far, like cleaning up an import table!