here is the javascript code to change the default filter of Account or Contact - Activities Filter to "All"
Default Activity ‘Filter on’ to ‘All’ Dynamics CRM 2016
Create a web resource on Account or Contact entity
Call below function on onLoad of Account or Contact entity.
function filterAllActivities()
{
parent.window.document.getElementById("navActivities").onclick = function ()
{
parent.window.Mscrm.Details.loadArea(this, "areaActivities");
parent.window.document.getElementById("areaActivitiesFrame").onload = function ()
{
var entityName = Xrm.Page.data.entity.getEntityName();
var entity = entityName.charAt(0).toUpperCase() + entityName.substr(1);
var doc = this.contentWindow.document;
var filterOn = doc.getElementById("crmGrid_" + entity + "_ActivityPointers_datefilter");
filterOn.value = "All";
var evt = document.createEvent("HTMLEvents");
evt.initEvent("change", false, true);
filterOn.dispatchEvent(evt);
};
};
}
No comments:
Post a Comment