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

In the academy documentation, there is limited information about using the ESQ/ORM server-side methods to delete data, with only 2 or 3 toy examples. We need to efficiently delete large volumes of data using server-side ESQ in one of our processes, but we can't see anything about bulk deleting while still firing off any event-based triggers on the entity or generating change log records for it. Obviously the direct Terrasoft.Core.DB delete statement would be very efficient, but would skip the Creatio logic where needed.

 

We've been able to delete records by iterating over a collection of entities matching the required filtering condition retrieved by using GetEntityCollection and then for each entity in the collection, running a FetchFromDB on its Id before deleting it, but this seems like quite a few steps more than should be required and doesn't do it in a batched way.

 

Any help would be greatly appreciated.

Like 0

Like

2 comments

Hello Harvey,

 

You can use out-of-the-box examples of bulk deletion logic. For example we can take the BulkEmailTargetArchiver class and the DeleteArchiveLevel method in it:

private void DeleteArchiveLevel(string sourceSchemaName, string targetSchemaName) {
			int processedRecords;
			do {
				var deleteQuery = new Delete(_userConnection).From(sourceSchemaName)
					.Where("Id").In(new Select(_userConnection)
						.Top(_batchSize)
						.Column("s", "Id")
						.From(sourceSchemaName).As("s")
						.Where().Exists(new Select(_userConnection)
							.Column(Column.Parameter(1))
							.From(targetSchemaName)
							.Where(targetSchemaName, "Id")
							.IsEqual("s", "Id")));
				processedRecords = deleteQuery.Execute(_dbExecutor);
			} while (processedRecords != 0);
		}

This is just one example of the logic. You can use:

 

select * from SysSchemaSource

where Source like '%DeleteQuery%'

 

to get other schemas in the application configuration with delete queries examples and build your own one using all examples you may find in the system.

Hi Oleg,

 

using these Delete classes bypasses Creatio’s internal logic though, right? So change logs will be inaccurate and any BPs that should be triggered on delete would not be triggered etc. This seems risky to me as important processes could hang off this, and I don’t know what other internal aspects of Creatio might be relying on logic that Creatio manages at an application level.

 

Is there any way to bulk delete while respecting that?

Show all comments

Hello Creatio community,

 

I'm trying to debug a service deployed in another server. Which is the easiest way to debug a source code schema type? Currently I install all package updates and sometimes the database (to debug existing test cases) locally but this procedure is very time consuming.

 

Is there an easier way to debug a source code locally without the first procedure?

 

Regards,

Lirzae

Like 0

Like

1 comments

Hello,



Please find more infomation on server code debugging here.

 

Show all comments

Hello Creatio Community,



In our "Lending 7.18.4 Creatio Product" our team wants to call "Fill in product terms" from the server side.

How can we call this functionality (generate application parameters) from the server side?

 

Regards,

Lirzae

Like 0

Like

1 comments

Hello,

 

Could you please specify from where exactly would you like to call this function and the purpose of it? Is it from a different application by calling a specific URL/endpoint?

 

Best regards,

Dariy

Show all comments

Hi Community,

 

I’ve this requirement where a specific user must run a specific Process. In this process, there should be a set of tasks that must gather all the attachments of the current record and generate a ZIP file with these attachments. Furthermore, this process should also download the ZIP file to the user’s computer.

 

Any idea on how can I achieve this requirement?

 

Thanks in advance.

 

Best Regards,

Pedro Pinheiro

Like 1

Like

4 comments

Hello Pedro,

Unfortunately, your task can not be achieved using the basic logic of Creatio. There is no possibility to generate ZIP files from attachments.

Also, you can not download some files to the user's computer automatically until he does not download them manually.

Best regards, Alex.

Hi there! We recently uploaded an application to the marketplace 
that allows you to download all the files of a section, example of an 
account, in a ZIP file. Possibly it is useful for your use case or 
to check how it was done. 
Check it here https://marketplace.creatio.com/app/download-zip-button-creatio

Thank you

Regards

Uriel,

 

Thank you for the response. We manage to find a solution for our requirement. However, If we get another use case like this one, we will have your application in mind.

 

Best Regards,

Pedro Pinheiro

 

Hi Pedro Pinheiro,

 

I am trying to achieve the same requirement . Would you be able to provide me the logic you used to create the zip and download it?. 

 

Best regards,

Pavan Manne

Show all comments

Hello community,



Can you please advise me how to run the server code (C#) from a client page (JS).

The business process has a delay when launching, so this method is not the best solution in my case.

 

Thank you in advance.

Mariia

Like 0

Like

2 comments
Best reply

Hello,

 

Please check the following link https://academy.creatio.com/docs/developer/back-end_development/configu…;



Best Regards,

Tetiana Bakai

Hello,

 

Please check the following link https://academy.creatio.com/docs/developer/back-end_development/configu…;



Best Regards,

Tetiana Bakai

As Tetiana mentioned, how this is typically done in Creatio is by creating a configuration web service that you call from your client-side js code. It's actually one of my favorite parts of Creatio and makes for a very powerful development experience and allows you to keep the UI very quick by passing things between the client and the server and performing operations on the server rather than the client. Along with the Academy article Tetiana shared, I also have a write up of how to create a configuration web service and call it from client-side code here: https://customerfx.com/article/creating-a-web-service-and-consuming-it-…

Ryan

Show all comments

Hello community,

 

Could you please advise me how to send a message from a page to a business process.

The idea is the next: the process starts and sends a message to the client with a confirmation question and waits for the message to continue.

The message will be generated on the client depending on the button pressed on confirmation pop-up window.

 

Thank you in advance for your ideas.

Best regards,

Mariia

Like 0

Like

1 comments

Hello Mariia,

 

I'm afraid there is no way to send a message from the client to some specific process log record (since ProcessEngineService.svc doesn't provide this option). Please re-design your process, use the "User dialog" element and use two (or more, based on answer options in the dialog) conditional flows after the "User dialog" element.  As a result you will be able to continue the process execution based on the answer option the client selects.

 

Best regards,

Oscar

Show all comments

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



Dear Community,

 

I am trying to copy values from a field and lookups to put it in the "Name" fields before saving.

I use the following code in the script task but I don't know how to get the value from a lookup:

Entity.Name = $"{Entity.Code } - {Entity.Description}";

Code being the lookup.



So if you create a record in a lookup it would go like this:

[Name][Code][Description]

[           ][ 001 ][Code for info]



The Name should automatically be filled with "001 - Code for info" after saving.

What is the correct way to set the script?

Thank you!

 

 

Kind regards,

Yosef

 

Like 0

Like

2 comments

Hi!

 

Just add on saving event in your lookup entity, and add a script

 

Entity.SetColumnValue("Name", string.Format("[{0}][{1}]", Entity.GetTypedColumnValue<string>("Code"), Entity.GetTypedColumnValue<string>("Descritpion"));

 

Dmytro Oliinyk,

 

 

Thank you but that didn't seem to work for me, this was the solution for me:

 

var name = Entity.GetColumnValue("Name");
var description = Entity.GetColumnValue("Description");
 
var esq = new EntitySchemaQuery(Entity.Schema);
esq.AddColumn("Code.Name");
 
var CodeEntity= esq. GetEntity(UserConnection, Entity.PrimaryColumnValue);
if (CodeEntity != null) {
 
	var columnUsrCodeName = CodeEntity .GetTypedColumnValue<string>("Code_Name");
 
	string fullName= $"{name}: {columnUsrCodeName } - {description}";
	Entity.SetColumnValue("Name", fullName);
}
return true;

Let me know if there's an easier way to do this.

 

 

Kind regards,

Yosef

Show all comments

Hi all,

I'm trying to filter some city data by city name

The following line will not match because it's not case-insensitive : 

esqFilter = esq.CreateFilterWithParameters(FilterComparisonType.Equal, "City", "PARIS");

Is there a way to ignore case so it works for the "Paris" value ?

Like 0

Like

1 comments

Dear Jerome, 

 

ESQ EQUAL comparison is not case sensitive so you are not getting a result either because you have other filters or there are no records with City column equals to Paris. 

As an alternative you can try using Select class: 

https://academy.creatio.com/documents/technic-sdk/7-16/retrieving-data-database

 

Best regards, 

Dennis 

Show all comments