Adding Custom Icons and ToolTip to Dynamics 365 Columns in Views

Adding Custom Icons and ToolTip to Dynamics 365 Columns in Views

With Dynamics 365 we can add custom icon and tooltips to the fields in Views. We can add it using the JavaScript through Web resource.

Follow the steps below to achieve this:

add 3 Web resources  as Png with names as “new_silver” & “new_golds”  & “new_diamonds” icons to webresource in Dynamics CRM.

3

 

Add the below Javascript webresource “new_Categorychange.js” in Dynamics CRM:

//rowval automatically comes fr0m the data
function getRowInfo(rowVal){
debugger;
var imageName = "";
var tooltipValue = "";
var resultarray = null;
var row = JSON.parse(rowVal);
var rdata = row.new_category_Value;
 
 switch(rdata){
 case 1:
 imageName = "new_golds";
 tooltipValue = "Golds";
 break;
 case 2:
 imageName = "new_silver";
 tooltipValue = "Silvers";
 break;
 case 3:
 imageName = "new_diamond";
 tooltipValue = "Diamonds";
 break;
 }
resultarray = [imageName, tooltipValue];
return resultarray;
}

rowval: Row Information will comes from the grid view

Entity name is “Custom”

  1. Navigate to Settings → Customizations → CustomEntity→ Views
  2. Open the “Custom Active” view.
  3. Select the “Category” column and click Change Properties. After this you will reach to “Change Column Properties” as seen in the below screenshot:21

Output:

4.JPG

Advertisements

Making Form readonly Through Javscript

Making Form Read only Through JavaScript

Making all the fields in a form Locked(i.e read only) through java script

function lock() {
   var controls = Xrm.Page.ui.controls.get();
   for (var i in controls) {
   var control = controls[i];
   if (control.getDisabled && control.setDisabled && !control.getDisabled()) {
       control.setDisabled(true);
       }
   } 
 }
Screenshot (64).png
Let’s Enjoy 🙂