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

Like 0

Like

3 comments

Dear Mariia,

 

You can just add validation on the page instead: 

methods: {
...
asyncValidate: function(callback, scope) {
    this.callParent([function(result) {
        if (!this.validateResponse(result)) {
            return;
        }
        this.Terrasoft.chain(
                this.validateUserConsent(function() {
                    next();
                }, scope);
            },
            function(next) {
                callback.call(scope, result);
                next();
            },
            this
        );
    }, this]);
},
validateUserConsent: function(callback, scope) {   
    //Show confiration dialog with this.showConfirmationDialog
    //If yes - this.Ext.callback(callback, scope || this);
    //If no - return;
}

Best regards,

Angela

Dear Angela Reyes,

 

Thank you for your reply.

But is does not work correctly for me, maybe because of mandatory activities in DCM.

I need all activities to be cancelled, in the case of switching to the Canceled stage.

How to perform such a task?

Thank you.

 

Best regards,

Mariia

Mariia Prostiak,

 

Hello,

 

But all the activities of the current stage are being canceled in case they were not completed and the stage is changed to the next one. Can you please specify why do you need to override this logic?

 

Best regards,

Oscar

Show all comments

I am searching for any article or guidance to add an confirmation message when user tries to change status in a section record, the system first asks user via confirmation message(pop up). The pop message should state whether if you are sure to change state or not with Yes or No option.

I only that there will be use of localizable strings in object schema but how it all adds up to create a pop message.

can anyone help in this matter?

Thank you

Like 0

Like

8 comments
Best reply

I do have this article describing how to show various prompts in Creatio via code, like confirmation dialogs etc.

https://customerfx.com/article/displaying-information-confirmation-and-error-dialogs-in-bpmonline/

 

Is that what you're after?

Ryan

I do have this article describing how to show various prompts in Creatio via code, like confirmation dialogs etc.

https://customerfx.com/article/displaying-information-confirmation-and-error-dialogs-in-bpmonline/

 

Is that what you're after?

Ryan

Hello Ryan,

 

Yes, I am looking for the exact thing. Currently I want to add a Prompting for Choices confirmation dialog written in your article to a section after change in status. 

 

Can you please tell me if any of Creatio CRM section have this in-built (confirmation message) so that I can find the code to understand how to bind functionality or process to the YES or NO button?

 

Thank you

Hello Ramnath Sharma,

 

Current versions of the Creatio CRM don't have such kind of ready in-built pop-up confirmation.

On the other hand you can try to use the methods which were provided by Ryan Farley:

 

https://customerfx.com/article/displaying-information-confirmation-and-…

 

Also in articles below you will be able to find information about other kinds pop-up windows (with input fields, buttons, etc.):

 

https://academy.creatio.com/documents/technic-sdk/7-15/adding-pop-summa…

 

https://academy.creatio.com/documents/technic-sdk/7-15/creating-pop-sum…

 

https://academy.creatio.com/documents/technic-sdk/7-15/creating-pop-sum…

 

https://academy.creatio.com/documents/technic-sdk/7-15/adding-pop-hints

 

You can also analyse the the any minipage code and create a custom page that would open upon your preferred conditions.

 

Best regards,

Roman

RAMNATH SHARMA,

 

Yes, you can use that code in a section, page, or anywhere in Creatio. To do a Yes/No prompt, you'd add code like this (from the article I posted)

Terrasoft.showConfirmation("Would you like to do the thing?", function(result) { 
    if (result === Terrasoft.MessageBoxButtons.YES.returnCode) {
        // the user selected "yes" - do something here if needed
    }
    else {
        // the user selected "no" - do something here if needed
    }
}, ["yes", "no"], this);

To show this confirmation after the user changes the Status field, you'd need to wire up a change event for that column, I describe how to do that here: https://customerfx.com/article/triggering-an-event-when-a-field-is-changed-on-a-page-in-bpmonline/

 

Inside the method that fires when the Status column is changed, you'd place the code above, and could then react as needed.

 

Hope this helps,

Ryan

Thank you Roman and Ryan.

 I will follow the suggested articles to implement pop up confirmation.

Ryan Farley,

Is it possible to send these informational / confirmation messages from business processes (Script tasks, maybe) ?

Ryan Farley,

Hi,

I want to use this code, but not sure where to add the code to?

Is that in a script task of a process?

Thanks

Chani Karel,

The code listed above and in the linked article are for client-side code (code that would exist on a page). It is possible to send a message from a process that would get received on a page, but that does require some programming on both sides (a script task in a process and also modifying code on a page, or somewhere in the client to receive the message from the process and display the prompt - however, there's no way to get the result of the prompt back to the process so it can proceed according to the value selected). This article explains how to send a message from a process to be received in the client https://customerfx.com/article/sending-a-message-from-server-side-c-to-…

Ryan

Show all comments