latest Post

Dynamics365 Custom FetchXML Sub Grids (Classic UI)

Recently we had a requirement to show Order information in a sub grid on the account page. Where this differed from a standard request was the customer wanted to show all Orders relating to the customer regardless of the association. For example, we  have multiple look ups to the account record on the Order entity for the various different parties for example Sold To, Ship To, Bill To and End User. 

To achieve this I dynamically generated a fetchXML query filtering the data based on the the id of the current record. Then using the "SetParameter" method injected the sub grid with the dynamics fetch XML  query. (see below). 

Update:  
It appears this does not work with the new Unified Interface as this stopped working during the upgrade but does work if I revert back to classic UI. Strange as I did think this was a supported method as I did not directly reference any DOM elements but it appears calling "SetParameter" was never supported. I have seen a workaround  here which talks about  overriding"Microsoft.Crm.Client .Core.Storage.DataApi.ListQuery .prototype.set_FetchXml" function. However, I prefer to use supported methods therefore I will look at achieving the same functionality using the Retrieve multiple plugin method instead. It does seem to be overkill though and I would expect Microsoft to have provided some supported function in which we could  easily inject FetchXML or Odata into a page using client side functionality.
Recommended Posts × +

0 comments:

Post a Comment