Creating a new dashboard layout using FormXML

In Chapter 3, Creating a Dashboard, readers were introduced to the six different dashboard layouts that are provided using the Dynamics CRM dashboard editor. This recipe will show the reader how to quickly create a custom layout that includes three tab sections.

Getting ready

This recipe will create a new dashboard and export a solution package. Please refer to the previous recipe Exporting a dashboard from Dynamics CRM for detailed information on how to export the solution package.

How to do it...

Carry out the following steps in order to complete this recipe:

  1. Navigate to the Solutions section in the Settings area. Create a new solution package with the following values and then save the solution package.

    Field

    Value

    Notes

    Display Name

    CRM Organization Overview Dashboard

     

    Name

    CRMOrganizationOverviewDashboard

    This value will be generated from the Display Name field.

    Publisher

    Default Publisher for orgebeb7

    There will be at least 1 default publisher for your CRM instance.

    Version

    1.0

     
    How to do it...
  2. After saving the changes, navigate to the solution package's Dashboard area and create a new dashboard by clicking on the New button in the toolbar, as shown in the following screenshot:
    How to do it...
  3. Create a new dashboard using the 3-Column Overview Dashboard layout. If needed then refer to Chapter 3, Creating a Dashboard, as it covers the steps needed to create a dashboard:
    How to do it...
  4. Do not add any components to the dashboard. Fill in the Name field with CRM Organization Overview Dashboard. Click on the Save and Close button to commit the changes and close the Dashboard Editor screen:
    How to do it...
  5. From the Solution Package screen, click on the Export Solution button, as shown in the following screenshot, and save the ZIP file to your machine. If needed, refer to the previous recipe, Exporting a Dashboard from Dynamics CRM, which covers all the steps involved in exporting a solution:
    How to do it...
  6. Once the file has downloaded, extract the contents of the ZIP file, and then open the customizations.xml file in an XML editor such as Visual Studio. Only the<Dashboards> element has data; this is where the changes will be made:
    How to do it...
  7. To create a dashboard with a total of three tabs that will be used for Sales, Service, and Activity data, we need to modify the FormXML elements directly. Locate and copy the last<tab> element in the<tabs> collection. Refer to the Understanding FormXML section later in this recipe for more information about the schema used in FormXML dashboards:
    How to do it...
  8. Paste the copied<tab> element, so that there are a total of three<tab> elements in the<tabs> collection, as shown in the following screenshot:
    How to do it...
  9. Expand the new<tab> element in your XML editor, so that you can modify the attributes directly. You will need to generate three new GUID values for the<tab> element's id attributes. If you are using Microsoft Visual Studio, there is a Create GUID function located under the Tools menu:
    How to do it...
    • The first GUID replaces the id attribute value for the<tab> element:
    How to do it...
    • The second GUID replaces the id attribute value for the<section> element:
    How to do it...
    • The third GUID replaces the id attribute value for the<cell> element:
    How to do it...
  10. The dashboard customizations are complete for the scope of this recipe. A new solution package .zip will need to be created, so that it can be imported back into Dynamics CRM. Using Windows Explorer, locate the three files that were unzipped in the earlier steps and compress them into a new .zip file.

Tip

Filename Versioning

It is a good suggestion to version compressed files to keep track of the newest one when importing. For example, the original export package was named CRMOrganizationOverviewDashboard_1_0.zip and after the changes were made, the new compressed file for import was named CRMOrganizationOverviewDashboard_1_1.zip.

How to do it...

Tip

Refer to the next recipe Importing a dashboard into Dynamics CRM for instructions on how to import a modified solution package.

There's more…

Although there are more FormXML changes that can be made using the XML editor such as changing cell heights and widths, or modifying text labels, the goal of this recipe was to create a dashboard layout that wasn't possible through the Dynamics CRM Dashboard Editor interface. The Dynamics CRM dashboard editor is still the preferred tool for adding charts, lists, and other components, as it provides a fast and easy WYSIWYG editor.

Using the FormXML.xsd schema file to validate customizations

Microsoft Dynamics CRM comes with a freely downloadable feature-rich SDK that provides detailed in-depth information about the inner working of Dynamics CRM along with useful code samples and templates to speed up the learning process. You can locate the latest version of the SDK on Microsoft's website or by searching for Dynamics CRM SDK in your favorite search engine.

If you have downloaded the Microsoft Dynamics CRM 2011 SDK there will be series of XSD schema files available for use. The files are located in the SDKSchemas folder. Including the XSD files in your XML editor as a validation schema allows you to validate and correct any changes that you make to the XML before importing back into the solution again.

In order to use the Dynamics CRM schema files, include a reference to the customizationssolution.xml file. This is the top-level file for the customizations.xml and will pull in the Dashboard FormXML information as well. Depending on the XML editor you are using, the instructions for including an XML reference file may vary. Please refer to your product documentation for more information.

Understanding FormXML

The following section provides a simple outline of FormXML, as it is used in dashboards in Dynamics CRM. In order to get an in-depth review of the many different elements and attributes available in the Form XML mark-up, you should download the Microsoft Dynamics CRM SDK or search the online MSDN libraries for more information.

<Dashboards>
<Dashboard>
<FormId>{GUID}</FormId>
<FormXml>
<forms>
<form>
<tabs>
<tab id="{GUID}">
<label/>
<columns>
<column>
<sections>
<section id="{GUID}">
<label/>
<rows>
<row>
<cell id="{GUID}">
<label/>
<control classid="{GUID}">
<parameters>
<VisualizationId/>
<ViewId/>
…etc…
</parameters>
</control>
</cell>
</row>
</rows>
</section>
</sections>
</column>
</columns>
</tab>
</tabs>
</form>
</forms>
</FormXml>
</Dashboard>
</Dashboards>

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.3.136