Hi Creatio,
I am trying to filter a specific contact by using ESQ by having multiple roles as filters. How can I able to achieve that on ESQ when I want to filter on Roles?
Here is my code:
var esq1 = Ext.create("Terrasoft.EntitySchemaQuery", {
rootSchemaName: "SysUserInRole"
});
esq1.addColumn("SysRole.Name", "Role");
esq1.addColumn("SysUser.Contact.Id", "ContactId");
esq1.filters.add("RoleFilter1", esq1.createColumnFilterWithParameter(
this.Terrasoft.ComparisonType.EQUAL, "SysRole.Name", "Role1"));
esq1.filters.add("RoleFilter2", esq1.createColumnFilterWithParameter(
this.Terrasoft.ComparisonType.EQUAL, "SysRole.Name", "Role2"));
esq1.getEntityCollection(function(result) {
if (!result.success) {
// For example, error processing/logging.
this.showInformationDialog("Data query error");
return;
}
var hasAQM = result.success && !result.collection.isEmpty();
if(hasAQM){
this.set("HomartOpportunityAuthQuoteManager", result.collection.getByIndex(0).$ContactId)
}
}, this);
Thanks,