Simple & efficient alternatives to GlideAjax(Asynchronous) using onSubmit Script in Service portal?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2024 10:45 PM - edited 12-02-2024 03:57 AM
What are the Simple and effificient alternatives to GlideAjax (Asynchronous) using onSubmit Client Script in Service portal, please share along with examples to understand.
Thank you............
PS - I read this, but did not understand - https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0783579
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2024 11:51 PM
Hi @Suggy
As the article mentioned, this behavior is due to the asynchronous nature of scripts. The form gets submitted before the response from the GlideAjax call returns.
You can refer to the screenshot below for a detailed explanation, along with a couple of posts where I provided accepted solutions for different use cases.
Ref:
Onsubmit catalog client script is not aborting the form from submitting.
Validate group names in a list collector variable to check if selected group has less than 2 members
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2024 09:21 PM
I see that the best and easy solution is to use "EfficientGlideRecord" 🙂