Good day.
I'm trying use Entity schema query for get the records from the database, but I when use the following code the result is zero, my code is following
showWorksDoneInfo: function() {
// Receiving the order end date.
//var dueDate = this.get("UsrFechaCompra");
// Calling the standard system method for the data window display.
//this.showInformationDialog(UsrFechaCompra);
var worksDonecount="0";
var esq = this.Ext.create(Terrasoft.EntitySchemaQuery, {
rootSchemaName: "UsrWorksDone"
});
//var car = this.get("Id");
//esq.addColumn(car);
esq.addAggregationSchemaColumn("Id", Terrasoft.AggregationType.COUNT, "WorksDoneCount",
Terrasoft.AggregationEvalType.ALL);
//Filtro por Id de carro en WorksDone
//var idCar = esq.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL,
//"UsrLookupCarWorkId", this.get("UsrLookupCarWorkId"));
//Agrego filtros a la consulta
//esq.filters.add("idCar", idCar);
//esq.getEntity(function(result)
//{
//worksDonecount = result.entity.get("WorksDoneCount");
//});
this.showInformationDialog(worksDonecount);
},
Result, is always "result is not defined"