Dynamics CRM 2011 Custom System Views for Sub Grids

Paul Nieuwelaar, 06 June 2012

In Dynamics CRM 2011 when adding a sub grid to a form, often the default view used is the ‘Active’ view, since the ‘Associated’ view is not available in sub grids, as you can only select Public views (Active/Inactive and Custom views). The problem here is that often the ‘Active’ view is customized to contain lots of information, usually to take up the whole screen space. This means when the view is displayed in a sub-grid, some information will be cut off, or even not important/required for the current situation.

 Dynamics CRM 2011 Custom System Views for Sub Grids

On the Account for example, there is a sub grid of Contacts by default. This sub grid uses the ‘Active Contacts’ view as its default view. However you will notice some of the last column is cut off, and it even contains information on the contacts ‘Parent Customer’, which will of course be the current account. To make this sub grid better, we can create a new custom view to remove the Parent Customer column, as it is not needed, which will also make all other columns fit within the available space.

Instead of creating the view from scratch, we can open the Active Contacts view, remove the Parent Customer column, and then click Save As to save the changes as a new View.

 Dynamics CRM 2011 Custom System Views for Sub Grids

You can then edit the sub grid properties on the Account form, to set the new view as the default.

 Dynamics CRM 2011 Custom System Views for Sub Grids

Optionally, you can now also ‘Deactivate’ the view from the Customizations area, which will remove it from the standard list of views on the contacts main screen, but it will still be used in your sub grid.

 Dynamics CRM 2011 Custom System Views for Sub Grids

NOTE: Only do this step if absolutely necessary, as there are several things to consider when using this trick. They are as follows:

1. Deploying customizations deploys all views as active, you must deactivate again manually.
2. To use the view in another Sub Grid, the view must first be activated again before it is assigned to the new Sub Grid.
3. This view must be the only available view in the sub grid (otherwise another one is used as default).
4. Choose to not display the Sub Grid name, as it appears blank.
5. When viewing the Sub Grid Properties after deactivating the View, another view will appear as the default, and if any sub grid properties are changed, the default view will be changed. 

Once completed, you will be able to see your custom view in the contacts sub grid on the account form, without being forced to use the default, active contacts view. All columns fit within the available space, and the unnecessary column has been removed.

 Dynamics CRM 2011 Custom System Views for Sub Grids

If you deactivated the custom view, it will also be removed from the main contacts list of views:

Dynamics CRM 2011 Custom System Views for Sub Grids