Hi guys,
I'm using Dynmaics CRM 2015 onPremise (7.0.0.3543) (DB 7.0.0.3543)
I want to customize a subgrid filter to dynamiccally show records according some criterias.
I'm using this code :
var ActivitiesSubgrid = window.document.getElementById("activities");
if (ActivitiesSubgrid == null)
ActivitiesSubgrid = window.parent.document.getElementById("activities");
if (ActivitiesSubgrid == null) {
setTimeout('CRM.Accounts.AddFilter()', 500);
return;
}
if (ActivitiesSubgrid.control != null) {
ActivitiesSubgrid.control.SetParameter("fetchXml", fetchxml); //set the fetch xml to the sub grid
ActivitiesSubgrid.control.refresh(); //refresh the sub grid using the new fetch xml
} else {
setTimeout('CRM.Accounts.AddFilter()', 500);
}
This code works fine in Firefox, but when I try it in Internet Explorer, this instruction don't work :
ActivitiesSubgrid.control.refresh();
there is no error in the IE debugguer console but it dosen't work. And this instruction dosen't work in both IE and Firefox.
Xrm.Page.getControl("activities").refresh();Did you have an idea about this behavior ?
var ActivitiesSubgrid = window.document.getElementById("activities");
if (ActivitiesSubgrid == null) ActivitiesSubgrid = window.parent.document.getElementById("activities");
if (ActivitiesSubgrid == null) { setTimeout('Paprec.Client.AddFilter()', 500); return; }
if (ActivitiesSubgrid.control != null) {
ActivitiesSubgrid.control.SetParameter("fetchXml", filter); //set the fetch xml to the sub grid
ActivitiesSubgrid.control.refresh(); //refresh the sub grid using the new fetch xml ActivitiesSubgrid.control.refresh(); //refresh the sub grid using the new fetch xml } else { setTimeout('Paprec.Client.AddFilter()', 500); }