It’s not uncommon to register a plugin on RetrieveMultiple message and fiddle with the output, e.g. drop some values, add some calculations, etc.
Chances are that you are changing the QueryExpression, and the plugin is working fine in the classic UI but you will have challenges migrating to Unified Interface.
The reason is that in the Unified Interface Dynamics 365 uses FetchExpression, so you’ll need to handle both cases if you want to use both classic UI and Unified Interface.
To reuse as much of the existing code as possible, use FetchExpressionToQueryExpressionRequest to convert, then do what you need to the QueryExpression, and then change it back with QueryExpressiontoFetchExpressionRequest. Sample code is available.
Thank you Guillaume Domont for the tip! (And don’t forget to send yours to jar@crmtipoftheday.com).
Cover photo by Lucas Vasques
Remember though that converting back and forth between FetchXML and QueryExpression impacts performance reasonably much, so going the extra mile to handle your query manipulation directly in the FetchXML is preferred.
Hey Colleagues,
I have an issue with MS for some time.
And to be honest the question I have is the same – as an input I still have a query expression. As an output – collection.
we use “Retrieve multiple” plugin as a data provider to call external service and fill in Virtual entity.
MS Support can’t provide any explanations or documents.
Can you please explain where this FetchExpression comes from and where it should be converted?
(For the moment everything works fine except the fact that we can see only one line on the interface and the message 1-8 of N records. However, they can’t be reviewed)
Thank you in advance.
Hi,
I’m facing similar problems, if I change the EntityCollection, it only shows the first one.
Ever find any solution for this ?
Hi Sergii,
not sure what the question is. For a long time classic web ui used QueryExpression to get the data (e.g. for grids).
In Unified Interface, the OOB code uses FetchExpression instead. They are both derived from QueryBase so only minimal code changes are required to change consumption from one to another. Now, internally CRM/CDS uses fetchxml so, regardless which class is used, in the end of the day it all gets converted to fetchxml. That’s why FetchExpression is probably faster. In addition, fetch allows you to do things not supported by QueryExpression.
Due to the changes in UI code, RetrieveMultiple plugins should expect to get either one (used to be just QueryExpression).
HTH
George
Hi,
I get the same problems, the problem is NOT on the query side(pre call), but on the post retrievemultiple, when I try to manipulate the BusisnessEntityCollection returned from the the query.
This works fine in the classic interface, but in UCL I either get an error, og the same result as Sergii (one row visible, and the counter in the bottom says there are more ex. 1-5 of 8)
Good day, colleagues,
Did you find any solution on one row in sub-grid?
hey,
add diffrent guids to each entity and also fill both id field and the entity id field with that value (Id and contactid for example..)
hope this help
This article explains it. Must add guid to the ID field as well as also explained by Oriel.
https://carldesouza.com/overriding-the-retrievemultiple-integration-pattern-updated-for-unified-client-interface/#comment-4795
May be try this one now.
https://medium.com/@chirag.kanzariya/uci-dynamics-crm-how-to-use-retrievemultiple-plugin-to-pass-custom-code-in-subgrid-f64c99f329ce