Hello,
We are trying to retrieve and display records related to an entity that are based on third level relationship. What i mean is we have Entity A that is related to Entity B with 1:N relationship. We have Entity B related to Entity C with 1:N relationship and then we have Entity C related to Entity D with a N:N relationship. We are trying to display all Entity D records in the form for Entity A. We were able to do this in classic UI using Fetch XML injected through Java Script that was based on an advanced find view. However with UCI, this breaks. For some reason the link entities are removed from the injected Fetch XML.
This is JS code we are using:
function UpdatePaxGrid(executionContext) { var formContext = executionContext.getFormContext(); var bookingNo = Xrm.Page.getAttribute('cts_name').getValue(); var seasonSet = Xrm.Page.getAttribute('cts_season').getValue(); var season = seasonSet[0].id; season = season.slice(1,-1); var fetchXml = "" "" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "";; if (Xrm.Internal.isUci()) { var paxSubGrid = formContext.getControl("BookingPassengerSubGrid"); if(paxSubGrid == null) { setTimeout(function () { UpdatePaxGrid(executionContext); }, 2000); return; } paxSubGrid.setFilterXml(fetchXml); paxSubGrid.refresh(); } else { var paxSubGrid = formContext.getControl("BookingPassengerSubGrid"); if(paxSubGrid == null) { setTimeout(function () { UpdatePaxGrid(executionContext); }, 2000); return; } paxSubGrid.getGrid().setParameter("fetchXml", fetchXml); //Refresh grid to show filtered records only. formContext.ui.controls.get("BookingPassengerSubGrid").refresh(); } }
However, this is the Fetch XML that is being injected one JS execution:
As you can see the link entities are stripped out.
Any suggestions how do i fix this? Thanks in advance.
Regards,
Nithin