Editar

Compartilhar via


Create a dashboard

Organization-owned dashboards can be created by using the Dynamics 365 Customer Engagement Web Services or by customizing the entity form in Dynamics 365 for Customer Engagement by editing the customizations.xml file.

Note

Some dashboards that are created by using the SDK or by customizing the entity form are not supported by the Dashboard Designer in the Web application. For more information, see Limitations: Creating dashboards by using the SDK or through form customization later in this topic.

Before creating a dashboard, consider the following:

  • Type of dashboard: If you want your dashboards to be available across the organization and do not want to manage the access levels at a more detailed level, you might want to create an organization-owned dashboard. However, if you are concerned about the access privileges and security of your dashboard, consider creating a user-owned dashboard where you have more control on who can access it.

    To create organization-owned dashboards, you must have the System Administrator or System Customizer role.

  • Dashboard layout: While creating dashboards, you have to use the FormXML to define the dashboard components and layout. For information about working with FormXML to define a dashboard, see Dashboard Components and FormXML Elements. For some sample FormXMLs of different types of dashboards, see Sample Dashboards.

Create a dashboard by using the SDK

To create a dashboard, create an instance of SystemForm for an organization-owned dashboard, or UserForm for a user-owned dashboard. The following sample shows how to create an organization-owned dashboard.



//This is the language code for U.S. English. If you are running this code
//in a different locale, you will need to modify this value.
int languageCode = 1033;

//We set up our dashboard and specify the FormXml. Refer to the
//FormXml schema in the Microsoft Dynamics CRM SDK for more information.
SystemForm dashboard = new SystemForm
{
    Name = "Sample Dashboard",
    Description = "Sample organization-owned dashboard.",
    FormXml = String.Format(@"<form>
            <tabs>
                <tab name='Test Dashboard' verticallayout='true'>
                    <labels>
                        <label description='Sample Dashboard' languagecode='{0}' />
                    </labels>
                    <columns>
                        <column width='100%'>
                            <sections>
                                <section name='Information Section'
                                    showlabel='false' showbar='false'
                                    columns='111'>
                                    <labels>
                                        <label description='Information Section'
                                            languagecode='{0}' />
                                    </labels>
                                    <rows>
                                        <row>
                                            <cell colspan='1' rowspan='10' 
                                                showlabel='false'>
                                                <labels>
                                                    <label description='Top Opportunitiess - 1'
                                                    languagecode='{0}' />
                                                </labels>
                                                <control id='TopOpportunities'
                                                    classid='{{E7A81278-8635-4d9e-8D4D-59480B391C5B}}'>
                                                    <parameters>
                                                        <ViewId>{1}</ViewId>
                                                        <IsUserView>false</IsUserView>
                                                        <RelationshipName />
                                                        <TargetEntityType>opportunity</TargetEntityType>
                                                        <AutoExpand>Fixed</AutoExpand>
                                                        <EnableQuickFind>false</EnableQuickFind>
                                                        <EnableViewPicker>false</EnableViewPicker>
                                                        <EnableJumpBar>false</EnableJumpBar>
                                                        <ChartGridMode>Chart</ChartGridMode>
                                                        <VisualizationId>{2}</VisualizationId>
                                                        <EnableChartPicker>false</EnableChartPicker>
                                                        <RecordsPerPage>10</RecordsPerPage>
                                                    </parameters>
                                                </control>
                                            </cell>
                                            <cell colspan='1' rowspan='10' 
                                                showlabel='false'>
                                                <labels>
                                                    <label description='Top Opportunities - 2'
                                                    languagecode='{0}' />
                                                </labels>
                                                <control id='TopOpportunities2'
                                                    classid='{{E7A81278-8635-4d9e-8D4D-59480B391C5B}}'>
                                                    <parameters>
                                                        <ViewId>{1}</ViewId>
                                                        <IsUserView>false</IsUserView>
                                                        <RelationshipName />
                                                        <TargetEntityType>opportunity</TargetEntityType>
                                                        <AutoExpand>Fixed</AutoExpand>
                                                        <EnableQuickFind>false</EnableQuickFind>
                                                        <EnableViewPicker>false</EnableViewPicker>
                                                        <EnableJumpBar>false</EnableJumpBar>
                                                        <ChartGridMode>Grid</ChartGridMode>
                                                        <VisualizationId>{2}</VisualizationId>
                                                        <EnableChartPicker>false</EnableChartPicker>
                                                        <RecordsPerPage>10</RecordsPerPage>
                                                    </parameters>
                                                </control>
                                            </cell>
                                        </row>
                                        <row />
                                        <row />
                                        <row />
                                        <row />
                                        <row />
                                        <row />
                                        <row />
                                        <row />
                                        <row />
                                    </rows>
                                </section>
                            </sections>
                        </column>
                    </columns>
                </tab>
            </tabs>
        </form>",
    languageCode,
    defaultOpportunityQuery.SavedQueryId.Value.ToString("B"),
    visualization.SavedQueryVisualizationId.Value.ToString("B")),
    IsDefault = false
};
_dashboardId = _serviceProxy.Create(dashboard);

For a complete sample, see Sample: Create, Retrieve, Update and Delete (CRUD) a Dashboard. For a sample to create a user-owned dashboard, and assign it to another user, see Sample: Assign a User-Owned Dashboard to Another User.

Create an organization-owned dashboard by customizing the entity form

The customizations.xml file that is exported with an unmanaged solution contains definitions for entity forms and dashboards. You can add or modify the customizations.xml file to add or update a dashboard.

Create a dashboard by customizing an entity form

  1. Log on to Dynamics 365 for Customer Engagement.

  2. Export a solution. For information about doing so, see Exporting, Preparing to Edit, and Importing the Ribbon.

  3. Browse to the customizations.xml file in the exported solution folder, and open it for editing.

  4. Browse to the end of the dashboards area in the customizations.xml file by searching for the following tag: </Dashboards>

  5. Before the </Dashboards> tag, add the following to define a new dashboard:

    <Dashboard>  
       <LocalizedNames>  
          <LocalizedName description="Dashboard_Name" languagecode="1033" />  
       </LocalizedNames>     
       <IsCustomizable>1</IsCustomizable>  
       <IsDefault>0</IsDefault>  
       <FormXml>  
          <forms type="dashboard">  
    *** Dashboard definition goes here. *** // See “Sample Dashboards” topic for the FormXML content to be used here.  
          </forms>  
       </FormXml>  
    </Dashboard>  
    
  6. Save the customizations.xml file.

  7. Import the .zip file as a solution in Dynamics 365 for Customer Engagement. More information: Exporting, Preparing to Edit, and Importing the Ribbon.

Limitations: Creating dashboards by using the SDK or through form customization

Certain dashboards that are created or modified using the Dynamics 365 Customer Engagement Web Services or through form customization are not supported by the dashboard designer in the Web application. Avoid the following while creating or modifying a dashboard using the SDK or through form customization.

General

  • Problem: You can create a dashboard that contains a tab without any section defined in the FormXML.

    Resolution: Make sure that you create a dashboard with at least one section defined for each tab in the FormXML.

  • Problem: You can create a dashboard that does not have the same number of <row> elements for a section as specified in the rowspan property of a <cell> element of the section in the FormXML. Ideally, the rowspan property value of a <cell> element and the number of <row> elements in a section must be same.

    Resolution: Make sure that you create a dashboard that has the same number of <row> elements for a section as specified in the rowspan property of a <cell> element in the section.

Grids

Problem: You can create a dashboard that contains grids with the <AutoExpand> parameter value set to Auto for the grid.

Resolution: Make sure that you specify the <AutoExpand> parameter value as Fixed for the grids in the FormXML while creating a dashboard.

IFRAMEs

Problem: You can create a dashboard that contains an IFRAME. This happens when you do not specify any value for the <Url> parameter for the IFRAME control in the FormXML.

Resolution: Make sure that you specify a value for the <Url> parameter while creating an IFRAME in the FormXML.

See also

Dashboards for Microsoft Dynamics 365 Customer Engagement
Using FormXML for Dashboards
Actions on Dashboards
Sample dashboards
Sample: Create, Retrieve, Update and Delete (CRUD) a Dashboard
Customize Entity Forms in Microsoft Dynamics 365 Customer Engagement