Hi,
I am using below code, it's working fine in Internet Explorer but not in Google Chrome.
Is there any other way to do this?
function FilterSubgrid() {
var ContactGrid = document.getElementById("Contact");
var Clientid = new Array;
var Clientid = Xrm.Page.getAttribute("new_client").getValue();
if (Clientid != "" ) {
if (ContactGrid == null || ContactGrid.readyState != "complete") {
setTimeout('FilterSubgrid()', 2000);
return;
}
var Clientid = Clientid[0].id;
var fetchXml = "<fetch distinct='false' mapping='logical' output-format='xml-platform' version='1.0'>";
fetchXml += "<entity name='new_client'>";
fetchXml += "<attribute name='statecode'/>";
fetchXml += "<attribute name='new_other'/>";
fetchXml += "<order descending='false' attribute='new_device'/>";
fetchXml += "<link-entity name='contact' alias='af' to='new_client' from='contactid'>";
fetchXml += "<filter type='and'>";
fetchXml += "<condition attribute='contactid' ";
fetchXml += "value='" + Clientid + "'";
fetchXml += " operator='eq'/></filter>";
fetchXml += "</link-entity>";
fetchXml += "</entity></fetch>";
ContactGrid.control.SetParameter("fetchXml", fetchXml);
ContactGrid.control.refresh();
}
}