Access to getXMLWait is not available in scoped applications , what is workaround ?

nthumma
Giga Guru

I am trying to query related list on submit and i am getting 'Access to getXMLWait is not available in scoped applications' infomessage on the form.

I am trying to do something similar to Make entry in related list mandatory

any workarounds?

25 REPLIES 25

dhasselquist
Mega Guru

In your script include, you must fully qualify the AbstractAjaxProcessor object, which I bolded below.




var LightsAPI = Class.create();


LightsAPI.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {


  type: 'LightsAPI'


});




(example taken from http://wiki.servicenow.com/index.php?title=Scripting_in_Scoped_Applications#gsc.tab=0)




Give that a try.


I am having the same issue and tried your solution but that did not work for me.


Katie A
Mega Guru

I am also having the same issue. I am using getXMLWait to process date validations on the server by calling a script include from a client script. The synchronous "wait" function is recommended to wait for a response before continuing. Any idea if this will be available again in Fuji?


Thijs Daemen
Mega Guru

Hi srnewbie,



we are experiencing the same issue. We were using getXMLWait for onSubmit validation, which doesn't work asynchronously. However we didn't find a proper workaround. We submitted an incident with ServiceNow on the 21st of May but there has not yet been a solution.



The workaround they provided was:



I have received quick response from Development about the scope of global API methods.


The development has confirmed that getXMLWait()/synchronous methods are NOT allowed in the application scopes.


The suggestion is to use getXML(callback) / asychronous method in a scoped application. As this is NOT supported at the application layer there is no work around to override it. I understand from you that getXMLWait() is essential for your business logic, may I suggest a timer as a temporary work around.



Something similar on the lines - setTimeout(function(){ alert("Hello"); }, 3000);



I don't think using timeouts is a proper solution or a good workaround, but it's all we have for now. ServiceNow did create a feature request for it, so hopefully it will be added in the future.



edit: some more excellent information from Cory Seering here: Re: Ajax Script Include issue in Fuji