I try to filter a subgrid and i get this error which is not very helpful
Could any one look at my fetchXml please and let me know what i am doing wrong
Thanks
function updateSubGrid() { //This will get the related products grid details and store in a variable. var relatedProducts = document.getElementById("Activities"); //relatedProducts= related[0].id; //Initializing the lookup field to store in an array. var lookupfield = new Array; //Get the lookup field lookupfield = Xrm.Page.getAttribute("regardingobjectid").getValue(); //This will get the lookup field guid if there is value present in the lookup if (lookupfield != null) { var lookupid = lookupfield[0].id; } //Else the function will return and no code will be executed. else { return; } //This method is to ensure that grid is loaded before processing. if (relatedProducts ==null ) { //This statement is used to wait for 2 seconds and recall the function until the grid is loaded. setTimeout('updateSubGrid()', 4000); return; } var fetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>"; fetchXml += "<entity name='activitypointer'>"; fetchXml += "<order attribute='modifiedon' descending='false' />"; fetchXml += "<filter type='and'>"; fetchXml += "<filter type='or'>"; fetchXml +="<condition attribute='statecode' operator='eq' value='1' / >" fetchXml +="<condition attribute='statecode' operator='eq' value='2' / >" fetchXml += "</filter>"; fetchXml += "</filter>"; fetchXml += "</entity>"; fetchXml += "</fetch>"; //Setting the fetch xml to the sub grid. relatedProducts.control.setParameter("fetchXml", fetchXml); //This statement will refresh the sub grid after making all modifications. relatedProducts.control.refresh(); }
please help