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