Substitute of getXMLWait() in scoped application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2024 08:57 AM
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!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2024 09:49 AM
There is a solution in the below thread which may work for you.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2024 10:46 AM
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; }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2024 11:01 AM
Hello, Thanks for you response. I see this error when I use g_scratchpad.