Dynamics 365 – Add Icons to Entity Views

1.   Introduction

Microsoft Dynamics 365 has a new feature added for customizing entity views, where-in we can add custom icons with tool-tip text to display in a column depending on the column value; we can also specify localized tool-tip text.

This can be done by using JavaScript web resource and icons as image web resource. Below are the steps to add icons and tool-tips to entity view.

Note :  Adding custom icons with tool-tip is supported only for read-only grids; this feature isn’t supported for editable grids.

The JavaScript function used for adding icons to view expects two arguments, they are

  1. Entire row object
  2. Calling user’s locale Id ( i.e LCID). It is used to specifies tool-tip text for icon in multiple languages.

Here we are selecting a custom two option set field which indicates the type of case (i.e Support or Fault). If the case is fault then show  blue color icon and  if support then red.

2.    Steps to add icons and tool-tips to entity view

  1. Get the icons of size 16*16 and add them as image web resource in dynamics (select number of icons based on your condition) .
  2. Add the below JavaScript function as a web resource.
    function DisplayCustomIcons(rowVal, userlcid) {
     var imageName = "";
     var tooltipValue = "";
     var resultarray = null;
     try {
     var row = JSON.parse(rowVal);
     var rdata = row.osm_casetype_Value;
     if (rdata == true) {
     imageName = "new_Fault";
     tooltipValue = "Fault";
     else {
     imageName = "new_Support";
     tooltipValue = "Support";
     resultarray = [imageName, tooltipValue];
     } catch (e) {
     return resultarray;
  3. Edit the view of desired entity.custicon_01
  4. Select the column for which the custom icons and tool-tip(s) are to be added and click on “Change Properties”.
  5. Select the web resource to it and enter the function name.custicon_03
  6. Save and publish the changes.
  7. Navigate to the entity and select the view.custicon_04

Posted By: Nitin Res, Osmosee

Are you interested? follow us and get notified of new posts

2 thoughts on “Dynamics 365 – Add Icons to Entity Views

Leave A Reply

15 − 12 =