How to add Alert message to a OOB Document pdf task Widget without cloning the widget?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2024 10:03 AM
Hi. I need to add a confirmation message on click of the submit button on a PDF document to-do task (which is configured through Widget). How can I achieve it using client scripts without touching the widget? Please advise. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2024 03:58 AM
Hello @SonaK ,
Create onsubmit client script and refer below logic or create BR and use same logic by removing return values:
(function executeRule(current, previous /*null when async*/) {
// Your condition to check before showing confirmation
if (current.some_field == 'some_value') {
// Show a confirmation message
if (!confirm('Are you sure you want to submit this task?')) {
// If the user clicks "Cancel", prevent form submission
return false;
}
}
return true;
})(current, previous);
Thank you!!
Dnyaneshwaree Satpute
Tera Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2024 05:22 AM
Hi @Dnyaneshwaree Thanks for your response! I already tried with an onSubmit script applied on the doc task table. But the problem is the submission of the task is embedded in a widget that the client script doesn't kick off on submission. Not if there is another table or way that I can have my client script on so that it can kick off when it is submitted through the widget.