Change Contact Associate View Filter RRS feed

  • Question

  • Hi ...

    I want to change the contact entity Activities associate view both "filter on" and "include"....that is The Filter on will be "All" and Include will be "This Record Only"...how can I change this using javascript in CRM 2011 rollup 16... the pictorial reference shown below.

    I already try the below code but it's not workout it return the Error: Object doesn't support property or method 'FireOnChange'.It set the values but no changes in records.

    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");
                var recFilterOn = doc.getElementById("crmGrid_" + entity + "_ActivityPointers_ViewControl");
                filterOn.value = "All";
                recFilterOn.value = "ImmediateRelatedView";
                var evt = document.createEvent("HTMLEvents");
                evt.initEvent("change", false, true);



    Monday, March 24, 2014 8:02 AM

All replies

  • Hi, could you try with

    filterOn.control.refreshGridView()  or refresh() method for both filterOn and recFilterOn?

    I did something similar for a custom entity, but I think that Activities are a little bit special.


    Monday, March 24, 2014 3:02 PM