Hi Community,
As per out of the box functionality assignee in Case Page is filtered only by Users which role is "All employees" now i want to change this to allow contacts with "All employees" and "All portal users" role will display. What is the method in case page behind this logic, i want to override it and change it?
Like
In order to change the filtration in the "assignee" lookup field please check the "Owner" attribute and its "filter" property in the CasePage schema. It's possible to create a replacing client module for the CasePage schema and override this attribute by setting the "filter" property to your newly created method. Here is the example below:
define("CasePage", [],
function() {
return {
entitySchemaName: "Case",
diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/,
attributes: {
"Owner": {
dataValueType: this.Terrasoft.DataValueType.LOOKUP,
lookupListConfig: {
hideActions: true,
filter: this.ownerFilter
}
},
},
methods: {
ownerFilter:function () {
var systemUserFilter = Terrasoft.createColumnIsNotNullFilter("[SysAdminUnit:Contact].Id");
var filters = Ext.create("Terrasoft.FilterGroup");
filters.addItem(systemUserFilter);
return filters;
}
}
};
}
);
Thanks for your reply,
In my replaced CasePage schema I copied the codes you have given, but what happened lookup filter did not override the existing filter for Owner it just displays all the contact records.
By the way in my Owner attribute aside from lookupListConfig I also have dependencies since I am also having other logic for the Owner is this causes the conflict why the lookupListConfig did not work?
Please feel free to use the example below. In the example all contacts with "All employees" or "All portal users" role are displayed in the "Assignee" lookup field. In order to implement the functionality the base OwnerFilter method from the BaseFiltersGenerateModule was replaced by the custom filter.
define("CasePage", ["ConfigurationConstants"],
function(ConfigurationConstants) {
return {
entitySchemaName: "Case",
diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/,
attributes: {
"Owner": {
dataValueType: this.Terrasoft.DataValueType.LOOKUP,
lookupListConfig: {
hideActions: true,
filter: function(){
var systemUserFilter = Terrasoft.createColumnIsNotNullFilter("[SysAdminUnit:Contact].Id");
var filters = Ext.create("Terrasoft.FilterGroup");
filters.addItem(systemUserFilter);
return filters;
}
}
},
}
};
}
);