Hi community,

 

The situation is the following :

 

 

To have some context, after importing some data from an Excel file in the "Calculateur" detail it does some calculations in the "Informations Prix" detail.

 

However, now when trying to implement a business process needed to recalculate the values in the “Informations Prix” detail when we delete some records, I encounter some problems.

I have tried to put a start signal as “When a ‘Calculateur’ is deleted” it starts the process. However, the problem is that I can’t obviously get the Id of the opportunity and the Id of the other calculator records related to it because the record is deleted and only AFTERWARDS it starts the process. So, the business process doesn’t find the Id of the “Calculateur” or the Opportunity related to the deleted record.

 

A good thing to note is that every record of the “Calculateur” has its own Id.

 

Furthermore, I have tried to start the process on an Event like this :

 

 Here, right next to the checkbox, it says : “Before deleting a record”

 

And to start the business process with a “Message signal” with “CSLCalculateurDeleting” as message. However, I don’t really understand how this works because I can’t get the Id of the opportunity anyway.

 

In addition to all this stuff, my idea, according to this article that tried to answer the same need as mine :

 

 

So, my idea was to implement a “Delete” button next to the “Calculateur” detail that will delete the selected record, get the Id of the Opportunity and start a process which now could have all the parameters that I need for my further recalculations. However, how can I get, in the JavaScript Client Side part of code, the Id of the selected record to delete ? See this example :

 

 

I want the Id of the record highlighted in blue.

 

What is the best way to implement this according to the different possibilities above ? Do you have any idea ?

 

Many thanks for the attention paid to this long question. Hopefully you can help me figure this out.

 

Best regards,

Jonathan

Like 0

Like

2 comments

Stop using the normal Delete of a record by rights and instead force users to Delete with a business process.

The business process then runs the logic and then Deletes record in the end. So far so good.

It's simpler to maybe run the Business process from the record page. (Double-click row to open). If you wanna use a button on the row, check this out: https://community.creatio.com/articles/add-button-active-row-detail

Hi Julius,

 

Thanks for your answer. I have found the answer to my questions and it was really simpler that I thought.

 

In fact, on the start signal of the process it is necessary to unthick the checkbox :

 

 

So that it is possible to get the Id of the opportunity related to the deleted record.

 

Best regards,

Jonathan

Show all comments

I would like to know how to listen to merge event with business process.

For instance, delete, create and modify events are there:

420.png

I would like to get Id of an entry that was merged, and then use it in business process. 

"Modify" is not always applicable. Sometimes an entry is not considered modified when merged.

Thanks in advance

Like 0

Like

1 comments

Hello Yuriy, 

There is no such out of the box functionality that allows you to subscribe on merge event due to unexisting of such event.

As workaround, you may try to modificate Deduplication process (starts when records are merging). The records that remains in the database is called golden record and id of golden record is the first id in collection that is transferred to deduplication process. 

So once you have this golden record, you may process is it as you wish.

Also please note that process of merging records is asynchronous. 



Regards,

Alex

Show all comments

Hi everyone,

We created a custom entity that has a Contact lookup called [UsrConsumidor] and we need to get a value from a Contact's field called [UsrTotalPtsAcumulados].



We got an exemple from the bpm'online academy (https://academy.bpmonline.com/documents/technic-sdk/7-10/entityschemaqu…) and followed the exactly same structure, but it's not working. 

​var contactId = this.get("UsrConsumidor");
 
// Create Terrasoft.EntitySchemaQuery class instance with [Contact] root schema.
	var esq = this.Ext.create("Terrasoft.EntitySchemaQuery", {
	rootSchemaName: "Contact"
});
 
// Add column with name of main contact of accounts that refers to given contact.
esq.addColumn("UsrVouchers.UsrConsumidor.UsrTotalPtsAcumulados", "ContactTotalPtsAcumulados");
 
// Get one record from selection on the basis of [Id] of card object and display it in an info window.
esq.getEntity(contactId, function(result) {
	if (!result.success) {
		// error processing/logging, for example
		this.showInformationDialog("Data query error");
		return;
	}
	this.showInformationDialog(result.entity.get("ContactTotalPtsAcumulados"));
}, this);

The error that is given in the console is: "errorCode: "FormatException", message: "Expected hex 0x in '{0}'." "

Am I doing something wrong or is there an easier way to get an object by ID?

Best regards,

Rogério Zampieri.

Like 0

Like

1 comments

Dear Rogerio,

You don't need to join tables, your root schema is already "Contact", you just need to specify the filter.

Moreover, please use this statement to achieve Id of the contact:

​var contactId = this.get("UsrConsumidor").value



 

​var contactId = this.get("UsrConsumidor").value;
 
// Create Terrasoft.EntitySchemaQuery class instance with [Contact] root schema.
var esq = this.Ext.create("Terrasoft.EntitySchemaQuery", {
	rootSchemaName: "Contact"
});
 
// Add column with name of main contact of accounts that refers to given contact.
esq.addColumn("UsrTotalPtsAcumulados");
esq.filters.add("IdFilter", esq.createColumnFilterWithParameter(
				Terrasoft.ComparisonType.EQUAL, "Id", contactId));
 
// Get one record from selection on the basis of [Id] of card object and display it in an info window.
esq.getEntity(contactId, function(result) {
	if (!result.success) {
		// error processing/logging, for example
		this.showInformationDialog("Data query error");
		return;
	}
	this.showInformationDialog(result.entity.get("ContactTotalPtsAcumulados"));
}, this);

Regards,

Anastasia

Show all comments