H all,
I have to bind fetch xml results and bind data to grid and refresh it . it couldn't happen .
code below
$(document).ready(function FilterConnectionSubgrid()
{
var ConnectionSubgrid =document.getElementById("OpportunityCurrentFiscalYear");
if(ConnectionSubgrid==null)
{
setTimeout(function () { FilterConnectionSubgrid(); }, 2000); //if the grid hasn’t loaded run this again
return;
}
var fetchXml ="<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>"
fetchXml += "<entity name='bis_projectbusinessunit'>"
fetchXml += "<attribute name='bis_name'/>"
fetchXml += "<attribute name='bis_project'/>"
fetchXml += "<attribute name='bis_keyaccount'/>"
fetchXml += "<attribute name='bis_estrevenue_base'/>"
fetchXml += "<attribute name='bis_estrevenue'/>"
fetchXml += "<attribute name='bis_estawarddate'/>"
fetchXml += "<attribute name='bis_businessunit'/>"
fetchXml += "<attribute name='bis_projectbusinessunitid' />"
fetchXml += "<order attribute='bis_name' descending='false'/>"
fetchXml += "<filter type='and'>"
fetchXml += "<filter type='or'>"
fetchXml += "<condition attribute='bis_competitor' operator='eq' uitype='competitor' value='" + Xrm.Page.data.entity.getId() + "'/>"
fetchXml += "<condition attribute='bis_competitor2' operator='eq' uitype='competitor' value='" + Xrm.Page.data.entity.getId() + "'/>"
fetchXml += "<condition attribute='bis_competitor3' operator='eq' uitype='competitor' value='" + Xrm.Page.data.entity.getId() + "'/>"
//fetchXml += "<condition attribute='bis_competitor' operator='eq' uiname='Alaska' uitype='competitor' value='{A576591D-EDEB-E411-80F3-C4346BACBF08}' />"
fetchXml += "</filter>"
fetchXml += "</filter>"
fetchXml += "</entity>"
fetchXml += "</fetch>"
//Set the fetchxml directly to subgrid
ConnectionSubgrid.control.SetParameter("fetchXml", fetchXml); //set the fetch xml to the sub grid
ConnectionSubgrid.control.Refresh(); //refresh the sub grid using the new fetch xml
});
please advice .