Are there any real use cases for using synchronous GlideAjax?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2024 08:50 AM
Are there any real use cases for using synchronous GlideAjax? If yes, can you share the scenarios.
Thanks in advance !!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2024 08:57 AM - edited 12-12-2024 09:00 AM
Hello @Suggy
Best example is when we are creating an email id. When we enter an email id it checks whether the typed email id is available or not and till then it doesn't allow us to perform any action on the page. This is done using getXMLWait() also called as synchronous call.
In Login window, until the username and password are not validated user cannot proceed further.
In a form, if one field in dependent on another field than we can use Synchronous GlideAjax. Such as Location and Time zone. If the user selects the location, then based on location time zone will get populated. So, till the time zone is loading user must wait for the same.
Please refer the below thread:
Please mark the answer as helpful and correct if helped.
Kind Regards,
Ravi Chandra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2024 08:59 AM
I have faced with some scenarios where I need to obtain information from the server before submitting the form to validate some conditions.
but you always can prevent the submission for the first time and then when you get your answer from the ajax, you can submitting manually the same ui action.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2024 09:01 AM
Hi @Suggy ,
1)Checking if an entered asset tag is unique before submitting the form to prevent duplicate records.
2)When user submitting the cmdb requests check the ci exists in table then proceed next.
Refer below link:
If my response helped, please mark it as the accepted solution ✅ and give a thumbs up👍.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2024 09:37 PM
@Anand Kumar P Thanks for the replying.
Considering this example:
1)Checking if an entered asset tag is unique before submitting the form to prevent duplicate records.
This can be done using OnChange client script + Ajax (ofcourse validation happens before form submit)
OR
use the before insert/update Business rule (validation happens after form submit)
May I know which is the preferred method? Using client script or BR? Rationale behind it.
PS - My understanding is, we should not prefer synchronous GlideAjax, BR's preferred. Glideajax is preferred only in asynchronous scenarios.
Just looking to hear from others 🙂