Hi,
I want to filter a subgrid.
My code :
function FilterCasesSubgrid() { var CasesSubgrid =Xrm.Page.getControl("lots_associes"); if(CasesSubgrid==null){ setTimeout(function () { FilterCasesSubgrid(); }, 2000); //if the grid hasn’t loaded run this again when it has return; } var fetchXml ="<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>"+"<entity name='new_lot'>"+"<attribute name='new_name' />"+"<attribute name='new_nomduprogramme' />"+"<attribute name='new_villelookup' />"+"<attribute name='new_loyertotal' />"+"<order attribute='title' descending='false' />"+"<filter type='and'>"+"<condition attribute='new_name' operator='eq' value='004' />"+"</filter>"+"</entity>"+"</fetch>";
//Here i set the fetchxml directly to subgrid alert("1"); CasesSubgrid .control.SetParameter("fetchXml", fetchXml); //set the fetch xml to the sub grid alert("2"); CasesSubgrid .control.Refresh(); //refresh the sub grid using the new fetch xml }
with that I only have the first alert who says '1'. The last alert isn't displayed and the subgrid isn't modified.
Do you have any idea?