In this webinar, our experts showcase a variety of demo use cases of how different components of the...
Is your view list overflowing? Is it difficult to find the views that are meaningful for you? Do you wish you could filter your CRM 2011 system views dynamically?
First of all, let's go through the out of the box configuration options in CRM 2011 that will help most of the cases:
If the above hints are not enough—for example, if you need to hide certain views dynamically based on business rules or security roles—you will need a custom plugin.
For example, your Opportunity view list might look like following:
But if you have a clear separation between the department handling New Opportunities and the department handling Renewals, the other department's views are nothing but distraction. We really want to check for the membership in a security role, team or business unit and dynamically show/hide views that are meaningful.
We can achieve this by using the RetrieveMultiple plugin against savedquery, registered on the pre-operation step. The idea of the plugin is that we attach additional criteria to the existing query. The easiest way to filter the views is by referencing something in the description. For example, our plugin filters to views that have 'Renewal' in the description:
Additionally, we could have a similar plugin in RetrieveMultiple for savedquery in the post-operation step, to dynamically set the default view. However, we do not recommend this as it would override the functionality from out of the box user level default views and pinned views.
Note that the idea spans from our CRM 4.0 blog Dynamic System Views in Microsoft CRM 4.0.
However, the plugin did need several changes in order to work and be optimized for CRM 2011.
Hope you have fun things planned for the holidays, and happy CRM'ing!
Thanks for he tip! This is going to help in a big way. We have specific needs and enjoy the freedom of only seeing what views are important to us. It helps to keep a clean, productive environment and prevents confusion when used by new employees.
Great tip! for anyone looking for some sample code here's an example of how to get into the RetrieveMultiple that Joe is talking about.
QueryExpression query = (QueryExpression)context.InputParameters["Query"];
EntityCollection collection = (EntityCollection)context.OutputParameters["EntityCollection"];
This is exactly what I need. Do you have the source of this plugin available somewhere?