Accessing global script include from scoped app

martin_chabarri
Mega Expert

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.

6 REPLIES 6

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


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.