Sunday 9 July 2017

How to Customize entity views in Dynamic CRM using JavaScript.

Customize entity views
Description:

In this example we explain that how to Customize entity Views in Dynamic CRM using JavaScript. Or how to customized the entities system views using JavaScript in dynamic CRM.or how to change the background color of the system views grid based on some condition using JavaScript. Or how to read the data or record of the system view grid and change the rows or columns color based on condition using JavaScript in dynamic CRM.

Below is the code displays different icons and tool tip text based on the Rating. You have to create the following image resource like new_Hot, new_Warm and new Cold. And also create on JavaScript resource and call this JavaScript resource on system views Rating Field.
Code:

function displayIconTooltip(rowData, userLCID) {   
    var str = JSON.parse(rowData);
    var coldata = str.opportunityratingcode_Value;
    var imgName = "";
    var tooltip = "";
    switch (coldata) {
        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;
}



0 comments:

Post a Comment