Simple & efficient alternatives to GlideAjax(Asynchronous) using onSubmit Script in Service portal?

Suggy
Giga Sage

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

 

2 REPLIES 2

Tai Vu
Kilo Patron
Kilo Patron

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.

TaiVu_0-1732866388263.png

 

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

 
Cheers,
Tai Vu

Suggy
Giga Sage

I see that the best and easy solution is to use "EfficientGlideRecord" 🙂