Saturday, April 6, 2013

Related records count in CRM 2011 chart

        Below is the screenshot of  Cases associated with Contact record(Fig. A). Here we can see two Cases for this Contact. In this exercise, the requirement is to display the related Case count for each Contacts in an Organization using charts.

Fig. A. Cases associated with Contact


Follow the below steps to create this chart in MSCRM2011.
  • Settings à Customizations à Customize the System à Entities à Case à Charts à New.
  • Name the chart à Select Case(Count) in Series and any field in Horizontal à Save & Close.
  • Select newly created chart à More Actions à Export Chart.
  • Open exported chart in Visual Studio.
  • Replace <entity> tag with below XML and Save.

1
2
3
4
5
6
7
8
9
<entity name="incident">
  <attribute alias="_CRMAutoGen_aggregate_column_Num_0" name="incidentid" aggregate="count" />
  <link-entity name="contact" from="contactid" to="customerid" alias="aa">
    <attribute name="fullname" groupby="true" alias="_CRMAutoGen_groupby_column_Num_0"  />
    <filter type="and">
      <condition attribute="statecode" operator="eq" value="0"/>
    </filter>
  </link-entity>
</entity>

  • In Charts, More Actions à Import Chart à Browse for updated XML file à OK à Replace à Close.
  • You can add this chart to Dashboard and which will looks like below(Fig. B).
Fig. B. Contact Vs Case count chart in Dashboard.

No comments:

Post a Comment