change GlideAjax method from GetXML() to GetXMLWait()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
remember getXMLWait() won't work on portal as it's not allowed as it's synchronous.
You can continue using getXML() which works in native + portal and is asynchronous.
getXMLWait() is synchronous and makes sense to use when next action is dependent and should wait till response comes from Script Include.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @sureshp89882164,
You should keep using getXML(). It’s asynchronous, works in both native UI and Service Portal, and keeps the interface responsive.
getXMLWait() is synchronous, freezes the UI, and isn’t supported in Service Portal, so it’s not recommended.
Your current script with the responseParse callback is the correct and safe approach for this scenario.
Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.