Substitute of getXMLWait() in scoped application

rajpalj
Tera Contributor

We have a requirement to block form submission after calculations in GlideAJAX response. Since getXML is async even though the submission fails we are not able to block the submission. 

Is there any other method we can use in scoped application to make this synchronous. Thanks!

3 REPLIES 3

Sohithanjan G
Kilo Sage

Hi @rajpalj 

To mitigate this fundamental behavior, the form should be submitted again and this should be handled in the callback function of the getXML.

function onSubmit() {
if (g_scratchpad.isFormValid){
	return true;
}
var actionName = g_form.getActionName();
var ga = new GlideAjax("SOMEFUNCTION");
ga.addParam(.....);
ga.getXML(function() {
	g_scratchpad.isFormValid = true;
	g_form.submit(actionName);
});
	return false;
}

Hello, Thanks for you response. I see this error when I use g_scratchpad.

rajpalj_0-1711130468135.png