Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Change Contact Associate View Filter

$
0
0

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";
   filterOn.FireOnChange();
   recFilterOn.FireOnChange();
            var evt = document.createEvent("HTMLEvents");
            evt.initEvent("change", false, true);
            filterOn.dispatchEvent(evt);
   recFilterOn.dispatchEvent(evt);
        };
    };

Regards,

Srimathy.


Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>