Plug-ins registered for RetrieveMultiple are not called for FetchXml reports

By | June 18, 2017

This is just a quick reminder to anyone thinking of creating a RetrieveMultiple plugin: they are not called for FetchXml reports (apparently, they are not called for the SQL reports either).

https://msdn.microsoft.com/en-us/library/gg328097.aspx?f=255&MSPPError=-2147217396

Why is it important?

Usually, we would use RetrieveMultiple plugin to either modify the query (in the pre-retrieveMultiple) or to do something with the records that have been retrieved(in the post-RetrieveMultiple). For example, we might use it to implement some sort of additional custom filtering. We might also use RetrieveMultiple plugins to implement custom security. We might use such plugins to implement language translation support. There is a bunch of interesting scenarios where RetrieveMultiple plugins can be very useful.

However, this is exactly why we need to remember of that little note above: plug-ins registered for RetrieveMultiple are not called for FetchXml reports.

Our highly elaborate security won’t work in the reports. Customized filtering won’t work there either. Language translations would have to be implemented separately. Basically, we will have to re-implement all that logic in the reports as well. However, there is still “Report Wizard” in Dynamics, so anyone having sufficient permissions can create their own report, which, again, will not be aware of the customizations we have implemented in the RetrieveMultiple plugins.

Are RetrieveMultiple plugins useless, then? Not at all. They simply have their limitations.

 

2 thoughts on “Plug-ins registered for RetrieveMultiple are not called for FetchXml reports

  1. shikha grover

    hello,
    Plugin execution is not supported against UCI metadata entities in genera, like savedQueryVisualization, userQueryVisualization, savedQuery, useQuery.
    I tried to trigger retrievemultiple, it is NOT triggering on Account view but trigger on advance find

    Reply
    1. Alex Shlega Post author

      Hey, metadata – I understand. But what about the account view – can you elaborate? For all regular entities views, it should work (except that you might be getting FetchQuery in the plugin, not Query Expression. Or vice versa… so if you are testing for a specific query type, you may need to convert)

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *