How you can display icons on views in Dynamics 365 entities
Here is the snippet how to display icons in a row in Dynamics 365.
//-------------------------------------------------------
// DIsplay icon for Fields in Row in D365
//----------------------------------------------------------
function displayIconTooltip(rowData, userLCID) {
var str = JSON.parse(rowData);
var coldata = str.cr375_subject_Value;
var imgName = "";
var tooltip = "";
switch (parseInt(coldata,10)) {
case 720450000:
imgName = "new_math";
switch (userLCID) {
case 1036:
tooltip = "French: Math";
break;
default:
tooltip = "Math";
break;
}
break;
case 720450001:
imgName = "new_computer";
switch (userLCID) {
case 1036:
tooltip = "French: Computer";
break;
default:
tooltip = "Computer";
break;
}
break;
case 720450002:
imgName = "new_science";
switch (userLCID) {
case 1036:
tooltip = "French: OppScience";
break;
default:
tooltip = "Science";
break;
}
break;
default:
imgName = "";
tooltip = "";
break;
}
var resultarray = [imgName, tooltip];
return resultarray;
}