Dear community,
I have a task: Show a confirmation dialog with OK and KO buttons to confirm Case cancelling if the user clicked on the Cancel status in DCM.
If the OK button, then the case will be cancelled.
If the KO button, then the case will return to the previous status.
I have tried to display a dialog box on the OnSaving event of the Case object.
Here is my function:
public override void OnSaving(object sender, EntityBeforeEventArgs e) {
string status = UpdateData(sender);
if(status!="Canceled") {
base.OnSaving(sender, e);
} else {
//Todo: Show dialog with question
//Todo: Get response OK or KO
/*if(response ="OK"){
base.OnSaving(sender, e);
}else{
e.IsCanceled = true;
}*/
}
}
Unfortunately, I have not found any information on how to display the dialog box on the server side.
I know the method of sending messages from the client side (this.showConfirmationDialog(message, function(returnCode )), but I don't know how to return the result of the pressed button to the server to complete the OnSaving method.
private void SendMessage(object sender) {
var entity = (Entity)sender;
var userConnection = entity.UserConnection;
string senderName = "MySenderNameCase";
string message = JsonConvert.SerializeObject(new {test = "status"});
MsgChannelUtilities.PostMessage(userConnection, senderName, message);
}
Please help me to implement this task.
Thank you in advance.
Best regards,
Mariia