How to add Alert message to a OOB Document pdf task Widget without cloning the widget?

SonaK
Tera Contributor

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!

1 REPLY 1

Dnyaneshwaree
Mega Sage

Hello @SonaK ,

Create onsubit client script and use below logic or use before insert/update BR and remove return values from the same logic:

(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);

 

Please accept my solution if it works for you and thumps up to mark it as helpful.
Thank you!!

Dnyaneshwaree Satpute
Tera Guru