Create and edit views

 

Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online

In Microsoft Dynamics 365, use views to define how a list of records for a specific entity is displayed in the application. A view defines:

  • The columns to display

  • How wide each column should be

  • How the list of records should be sorted by default

  • What default filters should be applied to restrict which records will appear in the list

A drop-down list of views is frequently displayed in the application so that people have options for different views of entity data.

The records that are visible in individual views are displayed in a list, sometimes called a grid, which frequently provides options so that people can change the default sorting, column widths, and filters to more easily see the data that’s important to them. Views also define the data source for charts that are used in the application.

In This Topic

Types of views

Accessing view definitions

Specify default views

Create and edit views

Choose and configure columns

Display custom icons instead of values in list views

Edit filter criteria

Configure sorting

Remove views

Dependencies

Managed properties

Types of views

There are three types of views, personal, system, and publicviews.

Personal views

You and anyone else who has at least User level access to actions for the Saved View entity can also create personal views. As system administrator, you can modify the access level for each action in the security role to control the depth to which people can create, read, write, delete, assign, or share personal views.

Personal views are owned by individuals and, because of their default User level access, they are visible only to that person or anyone else they choose to share their personal views with. You can create personal views by saving a query that you define by using Advanced Find or by using the Save Filters as New Viewsand Save Filters to Current Viewoptions in the list of views. These views are typically included at the bottom in lists of system or public views that are available in the application. While you can create a new personal view based on a system or public view, you cannot create a system or public view based on a personal view.

This topic is about how system administrators and system customizers work with system and public views. For more information about personal views, see Help & Training: Create, edit, or save an Advanced Find search.

System views

As a system administrator or system customizer, you can edit system views. System views are special views the application depends on, which exist for system entities or are automatically created when you create custom entities. These views have specific purposes and some additional capabilities.

Note

In earlier versions of the product you could delete or deactivate system views. Starting with CRM 2015SP1, you can’t delete or deactivate system views, however.

System Views

Description

Quick Find

The default view used when searches are performed using Quick Find. This view also defines which fields are searched when using search capabilities of Quick Findand Lookupviews.

Advanced Find

The default view used to display results when using Advanced Find. This view also defines the columns used by default when new custom public views or personal views are created without defining a view to use as a template.

Associated

The default view that lists the related entities for a record.

Lookup

The view you see when you select a record to set for a lookup field.

These views are not shown in the view selector and you can’t use them in sublists in a form or as a list in a dashboard. You cannot delete or deactivate these views. More information: Remove views

System views are owned by the organization so that everyone can see them. For example, everyone has organization-level access to read records for the View (savedquery) entity. These views are associated with specific entities and are visible within the solution explorer. You can include these views in solutions because they are associated with the entity.

Public views

Public views are general purpose views that you can customize as you see fit. These views are available in the view selector and you can use them in sub-grids in a form or as a list in a dashboard. Some public views exist by default for system entities and for any custom entity. For example, when you create a new custom entity, it will have the following combination of public and system views.

Name

Type

Active<entity plural name>

Public

Inactive<entity plural name>

Public

Quick Find Active<entity plural name>

Quick Find

<entity name>Advanced Find View

Advanced Find

<entity name>Associated View

Associated

<entity name>Lookup View

Lookup

You can create custom public views. You can delete any custom public views you create in an unmanaged solution. You cannot delete any system-defined public views. Custom public views added by importing a managed solution may have managed properties set that can prevent them from being deleted, except by uninstalling the managed solution.

Accessing view definitions

There are several ways you can access view definitions if you are a system administrator or customizer. On any list view for an entity, in the command bar you will find the following commands after you click or tap the ellipsis ( More Commands button in Appointment Activity) button:

  • View: Opens the definition of the current view in the default solution.

  • New System View: Opens a new window to create a new view for the current entity in the default solution.

  • Customize Entity: Takes you to the definition of the current entity in the default solution where you can then select Views.

  • System Views: Opens the same window as Customize Entity, except with Viewsselected.

Alternatively, you can navigate to the view definitions in the default solution by using the following steps:

Open a view

  1. Go to Settings > Customizations.

  2. Click Customize the System.

  3. Under Components, expand Entities, and then expand the entity you want.

  4. Click Views.

  5. Double-click the view you want to open.

This list of views has four filters you can use to find the views you want more easily:

  • All Active Views

  • Active Public Views

  • Inactive Public Views

  • Active System-Defined Views

If the entity that the view is associated with is part of an unmanaged solution, you can still create or edit views for that entity in the default solution. System views are associated with an entity and are not available as separate solution components. Unlike fields, views do not use a customization prefix in a unique name that should be consistent in a solution, so you do not need to create views in the context of a solution.

Specify default views

Unless someone has ‘pinned’ a different view as their personal default, they will see the default view that you specify. You can set any of the public views as the default view for an entity.

Set the default view for an entity

  1. Navigate to Viewsas described in Accessing view definitions.

  2. Select a Public view.

  3. On the menu bar, click More Actions> Set Default.

  4. Click Publish All Customizations.

Create and edit views

You can create custom public views by editing existing views and saving them with a different name or by creating a new view.

Also see Help & Training: Create or edit a public view for an entity.

Create a new view

  1. As described in Accessing view definitions, from a list view for the entity, on the command bar, select New System View.

  2. In the View Propertiesdialog box, provide a Nameand optionally a Descriptionfor the view.

  3. After you close the properties dialog you can do the following:

    • Choose and configure columns.

    • Edit filter criteria.

    • Configure sorting.

  4. When you are finished, click Save and Close.

  5. Click Publish All Customizations.

Edit a view

  1. Go to Settings > Customizations.

  2. Click Customize the System.

  3. Under Components, expand Entities, and then expand the entity you want.

  4. Click Views.

  5. Double-click the view you want to edit.

  6. To change the Nameor the Descriptionfor the view, click View Properties.

  7. Do the following:

    • Choose and configure columns.

    • Edit filter criteria.

    • Configure sorting.

  8. When you are finished, click Save and Close.

  9. Click Publish All Customizations.

Create a new view from an existing view

Follow the procedure to edit a view, except instead of choosing Save and Close, click Save Asand enter a new Nameand Descriptionfor the view.

Choose and configure columns

Along with the filter criteria, the columns visible in a view are very important to the value provided by the view. When you Create and edit viewsyou can perform the following tasks with columns:

  • Add columns

  • Remove columns

  • Change column width

  • Move a column

  • Enable or disable presence for a column

  • Add find columns

Add columns

You can include columns from the current entity or any of the related entities that have a 1:N entity relationship with the current entity.

For example, perhaps you want to display the owner of a user-owned entity in a column. You can choose the Ownerfield of the current entity to display the name of the owner. This will appear as a link to open the Userrecord for the person who is the owner. In this case, you also have the option to Enable or disable presence for a column.

If you want to display the phone number for the owner of the record, you must select **Owning User (User)**from the Record typedrop-down and then select the Main Phonefield.

Add columns to views

  1. While Create and edit viewsclick Add Columnsand the Add Columnsdialog box appears.

  2. Select the Record typeif you want to include fields from related entities.

  3. You can select multiple fields, even from related entities.

  4. When you have selected the fields you want, click OKto close the Add Columnsdialog box.

As you add columns, you will increase the width of the view. If the width of the view exceeds the space available to show it in the page, horizontal scrollbars will allow people to scroll and see the hidden columns.

Tip

If your view filters on data for a certain field so that only records with a certain value are shown, don’t include that column in the view. For example, if you are only showing active records, don’t include the status column in the view. Instead, name the view to indicate that all the records shown in the view are active.

Note

When you add columns to Lookup views for updated entities, only the first three columns will be displayed.

Remove columns

  1. While Create and edit views, choose the column you want to remove.

  2. In the Common Tasksarea, click Remove.

  3. In the confirmation message, click OK.

Change column width

  1. While Create and edit views, choose the column you want to change.

  2. In the Common Tasksarea, click Change Properties.

  3. In the Change Column Propertiesdialog box, choose an option to set the column width, and then click OK.

Move a column

  1. While Create and edit views, choose the column you want to move.

  2. In the Common Tasksarea, use the arrows to move the column left or right.

Enable or disable presence for a column

When the following conditions are true, people can a see a Microsoft Lynconline presence control in lists that shows if the person is available and allows people to interact with them by IM:

  • People use Internet Explorer.

  • People have the Lyncapplication installed.

  • People have Microsoft ActiveXenabled in Internet Explorer.

  • Your organization has enabled presence for the system in the system settings.

Important

Lync has been rebranded as Skype for Business. Currently, you’ll still see references to “Lync” in Microsoft Dynamics 365, but Dynamics 365 will work with Skype for Business.

The presence control and the setting to enable it are available only for columns that display primary fields for email-enabled entities (users, contacts, opportunities, leads, or custom entities).

Enable or disable Lync presence for a column

  1. While Create and edit views, choose the column you want to change.

  2. In the Common Tasksarea, click Change Properties.

  3. In the Change Column Propertiesdialog box, select or deselect Enable presence for this column, and then click OK.

Add find columns

Find columns are the columns searched by the application when people use the search for recordstext box displayed for lists or whenever there is the ability to search for records for an entity in the application, such as when people are searching for a record for a lookup field.

  1. Open a Quick Findview as described in Create and edit views.

  2. Click Add Find Columnsto open the dialog box.

  3. Select the fields that contain the data that you want to search for.

  4. Click OKto close the Add Find Columnsdialog box.

Display custom icons instead of values in list views

Some Relationship Insights features display list views that show icons rather than text or numerical values in some columns. Though this capability was created to support specific Relationship Insights features, administrators and customizers can also add new graphics and establish the logic used to select them based on a column values using JavaScript.

Note

Grid icons are only shown in the Web interface. They are not shown in Outlookor the mobile app.

Add custom graphics and JavaScript as web resources in Dynamics 365

  1. Create the new graphic files needed for your customization. We recommend an icon size of 16x16 pixels (larger images will be scaled down).

  2. Write one or more JavaScript functions that establish which icons to show for which values (you'll typically need one function for each column you want to customize). Each function must accept a row data object and a language (LCID) code as input and return an array containing an image name and tooltip text. For an example function, see Sample JavaScript function, later in this topic.

  3. Sign into Dynamics 365as an administrator and go and go to Settings> Customizations> Customize the System.

  4. The Default Solutionpop-up window opens. Navigate to Components> Web Resourceshere.

  5. Now, you'll upload your custom graphics, one at a time, as web resources. Click the Newbutton in the toolbar to create a new web resource. Another pop-up window opens to help you create the resource. Do the following:

    1. Give the new resource a meaningful Name. The is the name that you'll use to refer to each graphic from your JavaScript code.

    2. Set the Typeto the graphic format you've used to save your graphic file (PNG, JPEG, or GIF).

    3. Click on the Choose Filebutton to open a file browser window. Use it to find and select your graphic file

    4. Add a Display Nameand/or Descriptionif you wish.

    5. Click on Saveand then close the Web Resourcewindow.

  6. Repeat the previous step for each graphic file that you have.

  7. Now, you'll add your JavaScript as the final web resource. Click the Newbutton in the toolbar to create a new web resource. Another pop-up window opens to help you create the resource. Do the following:

    1. Give the new resource a meaningful Name.

    2. Set the Typeto Script (JScript).

    3. Click on Text Editor(next to the Typesetting) to open a text-editor window. Paste your Javascript code here and click OKto save it.

    4. Add a Display Nameand/or Descriptionif you wish.

    5. Click on Saveand then close the Web Resourcewindow.

  8. With the Default Solutionpop-up window still open, expand the Components> Entitiestree and locate the entity that you want to customize.

  9. Expand your entity and select its Viewsicon.

  10. You now see a list of views for your selected entity. Click on a view from the list to select it. Then open the More Actionsdrop-down list in the toolbar and choose Edit.

  11. A new pop-up window opens with controls for editing your selected view. It shows each column that is part of the view. Click to select the target column and then click the Change Propertiesbutton in the Common Tasksbox. The Change Column Propertiesdialog opens; make the following settings here:

    • Web Resource: specify the name of the web resource that you created to hold your Javascript functions (click the browse button to choose from a list).

    • Function Name: type the name of the function that you wrote to modify the selected column and view.

  12. Click OKto close the Change Column Propertiesdialog.

  13. Click Save and Closeto save your view.

  14. Repeat these steps for each entity, view, and column as needed.

  15. When you are ready, click Publish All Customizationsto publish your changes. Then you can close the Default Solutionpop-up window.

Sample JavaScript function

The JavaScript function for displaying custom icons and tooltips expects the following two arguments: the entire row object specified in layoutxml and the calling user’s Locale ID (LCID). The LCID parameter enables you to specify tooltip text in multiple languages. For more information about the languages supported by CRM, see Enable languagesand Install or upgrade Language Packs for Microsoft Dynamics 365. For a list of locale ID (LCID) values that you can use in your code, see Locale IDs Assigned by Microsoft.

Assuming you will be adding custom icons for an option-set type of attribute, which has a limited set of predefined options, make sure you use the integer value of the options instead of label to avoid localization issues.

The following sample code displays icons and tooltips based on one of three values (1: Hot, 2: Warm, 3: Cold) in the opportunityratingcode(Rating) attribute. The sample code also shows how to display localized tooltip text. For this sample to work, you must create three image web resources with 16x16 images in your Dynamics 365instance with the following names: new_Hot, new_Warm, and new_Cold.

function displayIconTooltip(rowData, userLCID) {    
    var str = JSON.parse(rowData);
    var coldata = str.opportunityratingcode_Value;
    var imgName = "";
    var tooltip = "";
    switch (parseInt(coldata,10)) {
        case 1:
            imgName = "new_Hot";
            switch (userLCID) {
                case 1036:
                    tooltip = "French: Opportunity is Hot";
                    break;
                default:
                    tooltip = "Opportunity is Hot";
                    break;
            }
            break;
        case 2:
            imgName = "new_Warm";
            switch (userLCID) {
                case 1036:
                    tooltip = "French: Opportunity is Warm";
                    break;
                default:
                    tooltip = "Opportunity is Warm";
                    break;
            }
            break;
        case 3:
            imgName = "new_Cold";
            switch (userLCID) {
                case 1036:
                    tooltip = "French: Opportunity is Cold";
                    break;
                default:
                    tooltip = "Opportunity is Cold";
                    break;
            }
            break;
        default:
            imgName = "";
            tooltip = "";
            break;
    }
    var resultarray = [imgName, tooltip];
    return resultarray;
}

This results in displaying icons with tooltips in the Ratingcolumn that depend on the value in each row. The result could look like this:

Custom column graphics example

Edit filter criteria

Along with the columns displayed in the view, the filter criteria that are applied to a view are a critical part of the value provided by the view.

  1. While Create and edit views, click Edit Filter Criteria.

  2. The dialog shows a user interface similar to Advanced Find. You can use ANDand ORclauses to specify and group criteria.

  3. Click OKto close the Edit Filter Criteriadialog box.

More information: Help & Training: Create, edit, or save an Advanced Find search

Configure sorting

  1. While Create and edit views, click Configure Sorting.

  2. In the Configure Sort Orderdialog box, in the Sort Bylist, select the column you want to sort, then click Ascending Orderor Descending Order.

  3. Click OKto close the Configure Sort Orderdialog box.

Remove views

Sometimes you have a view that you don’t want people to see. Depending on the type of view, you can either delete it or deactivate it.

Delete a view

You can delete any custom public view. Use the steps in Accessing view definitionsto find the view you want to delete and use the Delete buttonDeletecommand. Once you verify that you really want to delete it, the view will be permanently deleted.

If you don’t want to delete the view permanently, you can deactivate it instead.

Deactivate or activate views

You cannot delete or deactivate any System views, including public views the system created. You can deactivate any public view, including public views the system created

Deactivate or activate a public view

  1. Navigate to System Viewsas described in Accessing view definitions.

  2. Select a public view. To see inactive views, use the Inactive Public Viewsview.

  3. On the menu bar, click More Actions, and then click either Deactivateor Activate.

  4. Click Publish All Customizations.

Dependencies

Views are dependent on the fields that they display. The fields are required components for a view. If you have a custom field that is included in a view, you will not be able to delete that field while it is included in the definition of a view. Because views are usually presented as a list, other solution components are usually not dependent on a specific view. A chart may use a view as a data source, but it can use any of the views for an entity.

View the solution components with dependencies on views

  1. Navigate to System Viewsas described in Accessing view definitions.

  2. Select a view.

  3. On the menu bar, click More Actions> Show Dependencies.

The Dependenciesdialog box will list any dependent or required solution components for the view.

Managed properties

If you create a custom public view that you want to include in a managed solution that you will distribute, you have the option to limit the ability of anyone who is installing your solution from customizing the view.

By default, most views have their Customizablemanaged property set to true so that people can customize them. Unless you have a very good reason to change this, we recommend you allow people to customize views you create.

Set managed properties for a view

  1. Navigate to System Viewsas described in Accessing view definitions.

  2. Select a custom public view.

  3. On the menu bar, click More Actions> Managed properties.

  4. Set the Customizableoption to Trueor False.

Note

This setting does not take effect until you export a solution that contains the view as a managed solution and install it in a different organization.

See Also

Customize your Dynamics 365 system
What's new for administrators and customizers in Microsoft Dynamics 365
Getting started with customization
Customization Overview
Create and edit metadata
Create and design forms
Customize Dynamics 365 for phones and tablets
Create and edit processes
Create and edit business rules
Help & Training: Create or edit a public view for an entity
Help & Training: Create, edit, or save an Advanced Find search

© 2017 Microsoft. All rights reserved. Copyright