While submitting the request we need display error message if record is exist
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2024 02:59 AM
Hi Team,
We have a record producer in that subject common name field name is available, while submitting the request if certificate is exists we need to cancel the form and needs to display error message like this certificate already exist.
I have used below code but it is not working.
Script include:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2024 03:16 AM
@Balasai peela GlideAjax is an asynchronous call and when you use it on the onSubmit script, it doesn't block the UI, hence by the time you get the API response the form already gets submitted.
In this case you need to update your onSubmit script based on this article https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0779964
You can also draw inspiration from this article https://www.servicenow.com/community/developer-articles/async-validation-in-onsubmit-catalog-client-...
Please update your script accordingly and the form will be validated correctly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2024 03:22 AM
Hi Sandeep,
Thanks for your quick response.
Could you please provide code on this.
Regards,
Sai