I have a basic Order(new_ordernumber) / Details(OrdersDetailsSubGrid) type scenario.
Changing 'Order No' fires the OrderNumber_OnChange event.
This works in the classic Web but in Unified.
The value from window.parent.document.getElementById("OrdersDetailsSubGrid") is always null so the subgrid is never loaded with the new data.
Is there another way to do this in Unified.
function OrderNumber_OnChange()
{
var orderNo= Xrm.Page.getAttribute("new_ordernumber").getValue();
var OrdersTableSubGrid= window.parent.document.getElementById("OrdersDetailsSubGrid");
if (OrdersTableSubGrid!= null)
{
//fetch xml code
var FetchXml = "<fetch mapping='logical' version='1.0' distinct='false' output-format='xml-platform'>"; +
"ALL the fetch stuff'
FetchXml += "</fetch>";
OrdersTableSubGrid.control.SetParameter("fetchXml", FetchXml);
OrdersTableSubGrid.control.refresh();
}
else
{
setTimeout(OrderNumber_OnChange, 500);
}
}