
Hello all,
Does anybody know if the unsupported code below is available in a supported code? In other words, does anybody know if i can replace the document.getElementById with Xrm.page.???? or Xrm.data.????
function filterAllActivities() {
document.getElementById("navActivities").onclick = function () {
Mscrm.Details.loadArea(this, "areaActivities");
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);
};
};
}
BTW: this code works on CRM Online, but i will not use it because of the 'unsupported' situation.
Br,
Jacques
*This post is locked for comments
I have the same question (0)It looks like this code is trying to change the default activity filter to be 'All' - and unfortunately there is no supported way of doing this.
Hope this helps,
Scott