How to call Async function on submit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 08:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 08:40 AM - edited 01-17-2024 08:44 AM
Hi @PriyaVerma ,
Try result=='true' ,if it does not resolve your issue then please share the script include code?
Please mark my answer helpful if it resolves your issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 09:00 AM
In Script Include, I am checking the format of attachment from sysattachment table, if the format is valid then it returns true else returns false. Now in Client Script, I want to stop submit the record if result of Async function is false. So If result == 'false', message displays "Please upload valid format" and return false (stop submit the record). But this is not working,
The issue is that since the callback is asynchronous, it does not actually stop the form from being submitted. That's because the script proceeds along to submit the form before the callback has a chance to retrieve the value.