Accessing global script include from scoped app
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2017 06:54 AM
I am trying to do a simple GlideAjax from a scoped app, where I am calling a function in a global script include.
Client Side
function onSubmit()
{
var date = g_form.getValue("date_var");
var ga = new GlideAjax("MyInclude");
ga.addParam("sysparm_name", "getThisWeek");
ga.addParam("sysparm_ddate", date);
ga.getXML(ajaxResponse);
function ajaxResponse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
alert(answer);
Script Include
var MyInclude = Class.create();
MyInclude.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getThisWeek: function(){
gs.info('**mc: here i am');
var ddate = this.getParameter('sysparm_ddate');
if(ddate < gs.daysAgo(7)){
return true;
}
}
});
I am not getting any logs or errors, it just seems that it is not calling the include at all.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2017 06:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2017 07:11 AM
Yes it is marked as All application scopes

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2017 07:13 AM
you need to use getXMLWait for onsubmit client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2017 07:18 AM
Thanks for the suggestion.
I just tried and still no bueno.
Whats odd, it allows submission even with the synchronous call, and never hits the gs.info in the script include