Microsoft Dynamics® CRM Training
Inserting Charts into Forms
An error occurred while loading the video. Please try again.
In Microsoft Dynamics CRM, forms are highly customizable. You can insert new fields, reconfigure their layout, drag items to different sections, and even insert a Chart, which is what we will do in this lesson. Before we get started, it is important to know that at the time of this lesson’s publication, this functionality is NOT supported in the new flow forms.
In this scenario, I want to insert a pie chart into the old default form for the Contact entity. This Chart will display related Case records by priority. I can do this by inserting a sub-grid onto the form. Sub-grids don’t always have to be lists of data; they can be visualizations.
I begin by opening a Contact record. Notice that I have opened the default old form. Even though this is an entity that supports the new flow forms, as long as I am working with and configuring the old form, inserting a Chart isn’t a problem.
To open the Form Editor, I click the Customize tab of the ribbon, and then click Form. I want to add the Chart to the General section of the form, so I select it, click the Insert tab of the ribbon, and then click Sub-Grid.
The first thing I do when the List or Chart Properties dialog opens is give this sub-grid a Name. There can be no spaces in this field, so I type “CasesByPriority”. I enter “Open Cases” in the Label field, and then check the Display label on the Form option since I want the label to be visible. Now, I move on to the Data Source section. Charts reflect an open dataset, i.e. a list of records, so it is important that I set these criteria appropriately. Think of it as constructing a View, except instead of taking the form of a list of records, it will be a visualization of the data.
I want the Chart to represent Case records related to the Contact by their priority level. I select “Only Related Records” in the Records field, “Cases (Customer)” in the Entity field, and “Active Cases” in the Default View field.
Now that I have identified the data source, I need to check the Show Chart Only box in the Chart Options section. In the Default Chart dropdown, I select a System Chart. I have already created a pie chart in preparation for this lesson called “Cases by Priority”, so I select it.
Before I finish this sub-grid, I can configure its size on the form by clicking the Formatting tab. Here, I can choose the number of columns, or its width, and the number of rows, or its height. This is a two-column section, which means that is the maximum width for this sub-grid. I don’t want this visualization to be too short so I set the rows to eight. You may have to play around with the layout a bit until you get the desired outcome.
The sub-grid is ready to be placed on the form, so I click the OK button to close the dialog. Back at the Form Editor, I click the Home tab of the ribbon, and then I Save and Publish the form.
Once the customizations are published, I close and reopen the Contact record. I then see a nice pie chart that shows me related Cases by their priority. The one drawback to Charts on a form is that you cannot drill down into them. This means if I want to see which Case is a high priority, I cannot click the blue portion of the Chart to see the record. Therefore, some Charts would be served well to having a complimentary sub-grid that lists the records that the Chart represents.
For more tips, tricks, and tutorials, please refer to the Success Portal or our xRM.com blog.