Я использовал аналогичный код для загрузки сеток с помощью пользовательского FetchXML, но я не могу заставить его работать. Я получаю ошибку пространства вне стека. Я попытался изменить таймер, но это не помогло. Что-то изменилось в CRM, о котором я не знаю?Dynamics CRM 2013 SetParameter из пространства стека
функция UpdateSubGridRelatedMatters() {
var grid = document.getElementById("RelatedMTIGrid");
//If this method is called from the form OnLoad, make sure that the grid is loaded before proceeding
//Included extra null check as a rollup 5 fix
var relatedMatterID = Xrm.Page.data.entity.attributes.get("sage_relatedmatter").getValue()[0].id;
//if (relatedMatterID != null) {
//Update the fetchXML that will be used by the grid.
var fetchXml = "";
fetchXml += "<fetch version=\" 1.0\" output-format=\" xml-platform\" mapping=\" logical\" distinct=\" false\" >";
fetchXml += "<attribute name=\" sage_mtiid\" />";
fetchXml += "<attribute name=\" sage_name\" />";
fetchXml += "<attribute name=\" createdon\" />";
fetchXml += "<attribute name=\" sage_scientistisconsultant\" />";
fetchXml += "<attribute name=\" sage_secondlab\" />";
fetchXml += "<attribute name=\" sage_scientisthascfn\" />";
fetchXml += "<attribute name=\" sage_scientist\" />";
fetchXml += "<attribute name=\" sage_redlines\" />";
fetchXml += "<attribute name=\" sage_providermatterid\" />";
fetchXml += "<attribute name=\" sage_organizationcontact\" />";
fetchXml += "<attribute name=\" sage_organization\" />";
fetchXml += "<attribute name=\" sage_matterid\" />";
fetchXml += "<attribute name=\" sage_origin\" />";
fetchXml += "<attribute name=\" sage_materialtype\" />";
fetchXml += "<attribute name=\" sage_hostmatterid\" />";
fetchXml += "<attribute name=\" sage_hostcontact\" />";
fetchXml += "<attribute name=\" sage_host\" />";
fetchXml += "<attribute name=\" sage_executedbyhhmi\" />";
fetchXml += "<attribute name=\" createdby\" />";
fetchXml += "<order attribute=\" createdon\" descending=\" false\" />";
fetchXml += "<order attribute=\" sage_name\" descending=\" false\" />";
fetchXml += "<filter type=\" and\" >";
fetchXml += "<condition attribute=\" sage_relatedmtiid\" operator=\" eq\" value=\" " + relatedMatterID + "\" />";
fetchXml += "</filter>";
fetchXml += "</entity>";
fetchXml += "</fetch>";
if (grid == null || grid.readyState != "complete") {
//The subgrid hasn't loaded, wait 1 second and then try again
setTimeout(UpdateSubGridRelatedMatters(), 3000);
return;
}
debugger;
//Inject the new fetchXml
grid.control.SetParameter("fetchXml", fetchXml);
//Force the subgrid to refresh
grid.control.refresh();
// }
}
Хороший улов Спасибо – GoBeavs