Hi all,

I've tried to send a message from business process to frontend (freedom ui). However, every time got an error "The type or namespace name 'MsgChannelUtilities' does not exist in the namespace 'Terrasoft.Configuration' (are you missing an assembly reference?)".

I tried in different ways:

var userConnection = Get("UserConnection");

Terrasoft.Configuration.MsgChannelUtilities.PostMessage(userConnection, message, UserConnection.CurrentUser.Id);

AND

Terrasoft.Configuration.MsgChannelUtilities.PostMessageToAll(message, UserConnection.CurrentUser.Id);

AND ALSO

MsgChannelUtilities.PostMessage(userConnection, message, UserConnection.CurrentUser.Id);

I added usings Terrasoft.Configuration and Terrasoft.Configuration.MsgChannelUtilities to my BP but still, it doesn't work.

I found this issue in CRM trial version 8.1.1.3635.

Does anyone have any suggestions? Maybe there are some other ways to send and process the message?

 

Like 0

Like

2 comments

Hello,

 

Indeed, in this case, it is necessary to redesign the processes so that they are interpreted rather than compiled.

 

https://academy.creatio.com/docs/8.x/no-code-customization/bpm-tools/pr…

Kalymbet Anastasia,

Hello,

Thanks for your answer. Would you be so kind as to give me any recommendations about how I can notify frontend from backend without using messages?

Show all comments

I'm wanted to send a prompt message to the front-end at the end of my business process.

 

FrontEnd (The debugger never get fired)

init: function() {
        this.callParent(arguments);
        this.subscriptionFunction();
      },
      subscriptionFunction: function() {    
        debugger
        Terrasoft.ServerChannel.on(Terrasoft.EventName.ON_MESSAGE, this.onMyProcessMessage, this);
      },
      onMyProcessMessage: function(scope, message) {
        debugger
 
        if (!message || message.Header.Sender !== "ShowSuccessDialog") {
          return;
        }
 
        var message2 = message.Body;
 
        if (!this.Ext.isEmpty(message2)) {
          this.Terrasoft.showInformation(message2);
        }
      },

Business Process

string sender = "ShowSuccessDialog";
string messageText = "Successful";
 
MsgChannelUtilities.PostMessageToAll(sender, messageText);
 
return true;	



- And I'm receiving this error.

The server encountered an error processing the request. The exception message is 'Value for argument "name" must be specified.'

 

What name could this error mean? Or is this totally not related to my goal?



Reference

- https://community.creatio.com/questions/refresh-page-fields-after-proce…



Best Regards.

 

Like 0

Like

1 comments

1. Where are you seeing this error ?

2. 

string messageText = "Successful"; needs to be encoded as proper json.

try something like this

string messageText = "{\"prop\":\"Successful\"}";

 

and then in JS

var status = JSON.parse(message.Body).prop;

 

 

Show all comments