Async method client side

Hello Creatio community,

I am using Creatio base method:

/**
 * Opens edit page for selected record.
 * @protected
 */
editCurrentRecord: function() {
	const primaryColumnValue = this.getPrimaryColumnValue();
	// ** ESQ Method
	var object = this.GetObjData(primaryColumnValue);
	// existing implementation
	this.closeMiniPage();	
	if (primaryColumnValue) {
		this.editRecord(primaryColumnValue);
	}
},

Before page redirection I want to get all object data using ESQ filter ("GetObjData" method). The problem is that ESQ is asynchronous and the main method doesn't wait for "GetObjData" method to finish.

 

How can I convert "GetObjData" to synchronous so the main method "editCurrentRecord" awaits the child method?

 

Regards,

Lirzae

Like 0

Like

1 comments

Hello,

if you want to make your methods work in a defined order, you need to use the Terrasoft.chain logic. More about it in this article.

Show all comments