Colourful MSD 365 Views/Grid

new things

Many times client ask to make views colourful based on some condition in MSD 365.

In earlier MSD CRM version, it was big and totally unsupported change. But now we can do the same thing in a supported way.

Here we need to create JavaScript library for this single function, as it won’t work if the same library has any other function (it’s strange, but happened with me). Well, here are the steps for it

  1. Create attribute or use existing option set, e.g. priority
    1. Option set text: Low, value: 15
    2. Option set text: Normal, value: 14
    3. Option set text: Critical, value: 12
    4. Option set text: Blocker, value: 11
    5. …and so on…
  2. Get colour images of 16X16 for each type e.g.
    1. Option set text: Low ==> Image: soft_Low
    2. Option set text: Normal ==> Image: soft_Normal
    3. Option set text: Critical ==> Image: soft_Critical
    4. Option set text: Blocker ==> Image: soft_Blocker
    5. …and so on…
    6. please no that its should be fine with all image type but i tried with PNG only 
  3. Create a JavaScript library in system keep below function
  4. Register this function on the view ==> Attribute (Priority). Here is the post for how to execute JavaScript on MSD 365 views.
  5. It will look like below …

colourful view

6. well, here is JavaScript function for your reference ….

//exe on incident view
function displayIconTooltip(rowData, userLCID) {

//alert(“..yes, its View Script..!!”);
var str = JSON.parse(rowData);
var col_data = str.soft_priority_Value; // this is the attribute name from system
var imgName = “”;
var tooltip = “{” + col_data + “}”;

switch (col_data) {
case 16: //it is optionset value
imgName = “img_VeryLow”;  // it’s image name from system
tooltip = “Very Low”;
break;
case 15:
imgName = “img_Low”;
tooltip = “Low”;
break;
case 14:
imgName = “img_Normal”;
tooltip = “Normal”;
break;
case 13:
imgName = “img_High”;
tooltip = “High”;
break;
case 12:
imgName = “img_Critical”;
tooltip = “Critical”;
break;

case 11:
imgName = “img_Blocker”;
tooltip = “Blocker”;
break;

default:
imgName = ” “;
tooltip = “N/A”;
break;

}
var resultarray = [imgName, tooltip];
return resultarray;

}

7. This same configuartion will work for MSD Gris as well..

color grid

Caution:

  1. Please note that this function will execute on each record one by one, so it may affect the performance.
  2. This configuration won’t work for Editable Grid.

Thanks!!

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: