Hi,
I need to filter contact list that is displayed when logging a call activity through Section Actions Dashboard. Below is the code I have added for the same:
1. Replaced CallMessagePublisherPage
define("CallMessagePublisherPage", ["ConfigurationConstants"],
function(ConfigurationConstants) {
return {
entitySchemaName: "Activity",
mixins: {},
attributes: {
"Contact": {
"lookupListConfig": {
"columns": ["Account"],
"filters": [
function() {
var config = this.getListenerRecordData();
var additionalInfo = config.additionalInfo;
var account=additionalInfo.account.value;
var filterGroup = Ext.create("Terrasoft.FilterGroup");
if(account){
filterGroup.add("ContactFilter",
Terrasoft.createColumnFilterWithParameter(
Terrasoft.ComparisonType.EQUAL,
"Account",
account,
Terrasoft.DataValueType.LOOKUP)
);
}
return filterGroup;
}
]
}
}
},
methods: {
setDefaultCallDirection: function() {
var query = this.Ext.create("Terrasoft.EntitySchemaQuery", {
rootSchemaName: "CallDirection"
});
query.addColumn("Name");
var recordId = ConfigurationConstants.Activity.ActivityCallDirection.Outgoing;
query.getEntity(recordId, function(result) {
this.setDefaultCallDirectionQueryHandler(result);
}, this);
}
},
diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/
};
}
);
2. Replaced SectionActionsDashboard
define("SectionActionsDashboard", ["SectionActionsDashboardResources"], function(resources) {
return {
methods: {
onGetRecordInfoForPublisher: function() {
var info = this.callParent(arguments);
info.additionalInfo.account = this.getAccountEntityParameterValue(info.relationSchemaName);
return info;
},
getAccountEntityParameterValue:function(relationSchemaName){
switch(relationSchemaName){
case "Lead":
return this.getMasterEntityParameterValue("QualifiedAccount");
case "Contact":
case "Opportunity":
case "Order":
return this.getMasterEntityParameterValue("Account");
case "Account":
return {"value":this.getMasterEntityParameterValue("Id")};
default:
return {};
}
}
}
};
});
With above code, I get the below result in Account section when I open the window to select contact.
Above is the expected result. But when typing in the name on the lookup field instead of opening the selection window all contacts that match the text are displayed(not filtered by Account)
Any idea how to apply the same filter when pulling the list by typing in the lookup field?