Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

GlideAjax and interscope issue

mathieu_brule
Mega Sage

Hi !

 

I have an issue concerning calling GlideAjax script include between two differents scopes : 

 

I have my script include Ajax, client callable, and accessible from all scopes, in global scope : 

mathieu_brule_0-1790259865376.png

 

I have my client script, in Workplace Case Management scope, that tries to call this script include : 

   var requestedFor = g_form.getValue('requested_for');
    if (requestedFor != "") {
        var ga = new GlideAjax('global.getLocationAjax');
        ga.addParam('sysparm_name', 'getLocation');
        ga.addParam('sysparm_userid', requestedFor);
        ga.getXMLAnswer(getLocationAjax);
    }

 

Unfortunatly, it doens't work, I have following log : 

Script: getLocationAjax not found in scope: sn_wsd_case, and HTTP Processor class not found: com.glide.processors.xmlhttp.getLocationAjax: no thrown error

 

I don't understand why it tries to call getLocationAjax in sn_wsd_case scope, whereas I prefixed the call with the global scope 😞

 

Could you please help me ?

1 ACCEPTED SOLUTION

Brad Bowman
Mega Patron

Good job on the screen shots, posted script and log - this really helps understanding.  Are you certain that this client script is the one generating the error - not an errant previous attempt that is triggering?

View solution in original post

3 REPLIES 3

Brad Bowman
Mega Patron

Good job on the screen shots, posted script and log - this really helps understanding.  Are you certain that this client script is the one generating the error - not an errant previous attempt that is triggering?

Whoa, so ashamed... Indeed, another client script was attempting to call the same script include, but without any scope specification...

 

The simple answer in often the best 🙂

 

Thanks a lot !

No worries - we've all been there. 😊