Question

How to get total sales amount for a account

How to get total sales amount for a account

Like 0

Like

2 comments

You can get the amount of orders following the example below, the sum of likes is summed up there and saved in the Details field in the documentation

var select = this.Ext.create("Terrasoft.EntitySchemaQuery", {rootSchemaName: "Like"});
select.addAggregationSchemaColumn("LikeIt", this.Terrasoft.AggregationType.SUM, "LikeItSUM");
select.filters.addItem(select.createColumnFilterWithParameter(this.Terrasoft.ComparisonType.EQUAL,
					"KnowledgeBase", this.get("Id")));
		var callback = function(response) {
			var likeItSUM = "";
			var responseCollection = response.collection;
			if (response.success && !responseCollection.isEmpty()) {
				var result = responseCollection.getByIndex(0);
				likeItSUM = result.get("LikeItSUM");
			}
			this.set("LikeItSUM", likeItSUM);
		};

 

Dear Ankit, 

You can also create a dashboard or an aggregate column if the aim is to display the data. The dashboard would look something like this https://prnt.sc/l29tcd. And the aggregate column in account section can be set up something like this https://prnt.sc/l29vo3. 



Best regards,

Dennis

Show all comments