Omkar Kumbhar
Mega Sage

Hello @Supriya25 ,

Please find the client script. Please uncheck the isolate script checkbox.

OmkarKumbhar_0-1673890555647.png

 

function onSubmit() {
//Type appropriate comment here, and begin script below
if (g_form.getActionName() == "resolve_incident") {
//function confirmDialog(){
var gm = new GlideModal('confirm');
//Sets the dialog title
gm.setTitle('Confirmation');
//Set up valid custom HTML to be displayed
gm.renderWithContent('\
<div style="padding:15px"><p>Confirm?</p>\
<div style="padding:5px;float:right">\
<button style="padding:5px;margin-right:10px" \
onclick="window.takeAction(this.innerHTML)" \
class="btn btn-default">Do Change</button>\
<button style="padding:5px" \
onclick="window.takeAction(this.innerHTML)" \
class="btn btn-primary">Confirmed</button>\
</div> \
</div>');

//We'll use the windows object to ensure our code is accessible from the modal dialog
window.takeAction = function(thisButton){

//Close the glide modal dialog window when either button is pressed.
gm.destroy();

//perform the appropriate action on the client.
if(thisButton=='Confirmed'){
g_form.addInfoMessage('Incident is resolved successfully'); // modify this 29 and 30 line accodin to your requirement
g_form.save();

} else if(thisButton=='Do Change') {
g_form.addErrorMessage('Please carry out changes');
gm.destroy();
}
};
return false;//prevents the form from submitting when the dialog first loads
}
}

 

Thanks,

Omkar

 

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.