Can we do one GlideAjax call from callback function on another GlideAjax in onSubmit client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2024 03:24 AM
I have requirement to fetch request state from server on client side. Based on state of request, need to update few fields to other table on submit of form.
I am using Onsubmit client script, Used 1st GlideAjax call to fetch state of request (request is reference field). Inside call back, if request state is approval, need to update few fields. For this doing 2nd GlideAjax call. But this 2nd call is not working at all, it is not going to script include mentioned in glideajax.
Need to know if we can do one GlideAjax call from callback function on another GlideAjax in onSubmit client script. If yes, how?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2024 03:54 AM
Hi @MohsinT ,
Yes we can do that, although it's not a good practice to use GlideRecord in client script. Can you paste your code for the reference, so that I can troubleshoot.
Please share both Script include and client script code.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2024 03:56 AM
Hello @MohsinT ,
Use that logic in script include using multiple functions and call it from client script.
Please refer below article for the same:
https://www.servicenow.com/community/developer-forum/can-i-use-one-glideajax-to-call-several-functio...
Please accept my solution if it works for you and thumps up to mark it as helpful.
Thank you!!
Thank you!!
Dnyaneshwaree Satpute
Tera Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
Hi MohsinT,
I am running into exactly the same issue you described here, did you ever figure this out? If so what was your solution? Please advise.
Thanks,
Johannes