- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2017 05:21 AM
Hi ,
how to call global script include from private scope application.
below is the client script code which is calling script include from global scope, I want to use same code and call same script include but when working in my private scope.
What changes needs to be made in the code
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2017 02:46 PM
Hey Anshul,
You can try simply adding 'global.' when you initialize the global script include in your scoped app. For example it would look like this:
var scriptInclude = new global.scriptInclude();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2017 10:52 PM
Hello Anushl,
Globally scoped scripts with 'Accessible' from this scope only' cannot be called from Scoped Applications.
You need to write your own functionality to mimic that script.
NOTE: If you plan on publishing your app, you won't be able to include the scope access change to that script.
- Changes to globally scoped items will not be included in your Update Set.
- It will not be certified.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2017 12:15 AM
Below is my code...
Can some one convert this code to code with glide ajax as i got to know that we can not use glide record in application scope.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if(newValue)
{
alert('opened for is' + g_form.getValue("opened_for"));
var loc = new GlideRecord("sys_user");
loc.addQuery("sys_id",g_form.getValue("opened_for"));
loc.query();
if (loc.next())
{
g_form.setValue("location",loc.location);
}
}//Type appropriate comment here, and begin script below
}
I just want to get location field to auto populate on my form as soon as opened for gets changed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2017 10:30 AM
Hey Anshul,
Here's a quick example of using glide Ajax to make a glide record query asynchronously.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if(newValue)
{
alert('opened for is' + g_form.getValue("opened_for"));
var ajax = new GlideAjax('ContextActionsAjax');
ajax.addParam("sysparm_name", "getLabel");
ajax.addParam("sysparm_user_id", g_form.getValue("opened_for"));
ajax.getXml(setLocationValue);
}//Type appropriate comment here, and begin script below
}
function setLocationValue(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
g_form.setValue("location", answer);
}
Create a new script include that extends AbstractAjaxProcessor and put your glide record query there. Something like this: