Search code examples
dynamics-crm-2011dynamics-crmcrmmicrosoft-dynamics

dynamics 365 crm - plugin determine when refreshed was invoked


On the retrieve multiple message, is there a way to know when the user explicitly refreshes a subgrid? My plugin needs to distinguish between a refresh and a search/filter. The problem is the query that comes through in retrieve multiple message has filter criteria and sort order, so I cannot use those conditions to determine if it was refreshed.

thanks in advance


Solution

  • In a plugin's RetrieveMultiple handler it is not possible to determine the origin of the query (Lookup view, Active, Associated or Advanced Find view). Plugins are designed to be transparent and do not keep track of the state of the user session spanning multiple requests.

    One solution I could think of is to keep track of the user's subsequent actions trying to recognize a second request for the very same page of data for a specific user. In a multiserver (e.g. load balanced) configuration it will not be easy to make this a robust solution. Also, a scenario like opening a window with a specific page, closing it and reopening the same page could lead to unexpected behaviour. I am sure there are a few other issues such a design would bring with it and therefore I would advise against it.