Alert on catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2024 06:24 AM
Hello All,
I have a requirement where if a ci had an outage it will show alert when an incident will be raised for the same ci on employee portal. So I wrote a script include and catalog client script. The catalog client script works. It is showing me alert and the form is not submitting. But after that when I am trying to raise another incident based on other ci which does not have an outage incident form is not submitting.
Catalog client script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2024 08:22 AM
Due to its asynchronous nature, you cannot use getXML... in an onSubmit Catalog Client Script to prevent submission of the form. The form submission continues without waiting for the server response. In your case the final return false is always preventing the form submission. There are numerous posts on work-arounds. The most straight-forward is to move the Glide Ajax call to an onChange client script when a mandatory variable changes, then clear a mandatory variable if the alert is triggered, thereby preventing submission of the form.