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 07:25 AM
My bad!! getXMLWait is not supported in scoped app
Scoped Applications and Client Scripts: A Primer
can you try the same script with onchange and see if you were able to log info message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2017 08:02 AM
I ended up doing my validation on the client side.
Thanks for the help, the link you provided has a ton of great info on scoped apps.