Associated Views

  • Posted on: 24 October 2016
  • By: feridun

In CRM, associated views are used to display lists of records when viewing related items within a record. An entity can have more than one associated view. So for example, when viewing activities from within an account, contact and so on, you can choose between the following views:

  • All Planning Activities Associated View [why is this the only view to use the plural, "activities"?]
  • Open Planning Activity Associated View
  • All Activity Associated View
  • Closed Activity Associated View
  • Open Activity Associated View

When you navigate to activities in the related items of a parent record, the Open Activity Associated View is shown by default. Many people have asked how to change the default view shown and some have tried using the Set Default action. There are two issues here:

  • There seems to be no supported way to set the default view shown
  • Set Default only applies to Public Views which are shown when navigating to a entity list and do not apply to associated views

So it seems we hit a dead end. Well, since we can't create additional associated views nor change the default view used I thought why not try changing the filter criteria for the default associated view used. So, open a solution that contains Activity or use the Default Solution and navigate to Entities > Activity > Views. Open the view Open Activity Associated View and then click Edit Filter Criteria and we are in luck, the criteria can be edited. However, in my browser I wasn't able to see the complete definition, notice how the values for Equals don't show and there is no way to resize the window.

<screenshot>

To see the values I removed the AND grouping.

<screenshot>

And now I see the two values are Open and Scheduled.

I also confirmed this by creating a solution that contains just the Activity entity and the Open Activity Associated View - isn't being able to add selected bits of an entity great rather than getting everything?

Looking at the Fetch XML confirms what the graphical filter display shows:

           <filter type="and">
                    <filter type="and">
                      <condition attribute="isregularactivity" operator="eq" value="1" />
                      <filter type="or">
                        <condition attribute="statecode" operator="eq" value="0" />
                        <condition attribute="statecode" operator="eq" value="3" />
                      </filter>
                    </filter>
            </filter>

confirming what I saw in the Edit Filter Criteria window.

Now, in the Edit Filter Criteria window I clicked Clear to remove all selection criteria and then changed the view name to reflect that this is for all activities. I used All (was Open) Activity Associated View to remind me of the change. Save the view and then publish.

Users can still view only open activities by selecting the Open Activities public view.

 

 

 

 

CRM Topics: 
Review: