Tuesday, July 30, 2013

Open UI -->Scenario 1--Change the colour of the ROW in the list applet when the revenue is more than 2,000,000

Only PR change is required for this .

if (typeof(SiebelAppFacade.OpptyListPR) === "undefined") {
    SiebelJS.Namespace("SiebelAppFacade.OpptyListPR");
    SiebelApp.S_App.RegisterConstructorAgainstKey("OpptyListPR", "SiebelAppFacade.OpptyListPR");

    SiebelAppFacade.OpptyListPR = (function () {
        function OpptyListPR(pm) {
            SiebelAppFacade.OpptyListPR.superclass.constructor.call(this, pm);
        }

        SiebelJS.Extend(OpptyListPR, SiebelAppFacade.JQGridRenderer);

        OpptyListPR.prototype.BindData = function SetColor() {
            SiebelAppFacade.OpptyListPR.superclass.BindData.call(this, SetColor);
            var pm = this.GetPM();
            var recordset = pm.Get("GetRecordSet");
            var placeholder = pm.Get("GetPlaceholder");
            var rsLength = recordset ? recordset.length : 0;
            var trFinder;
            var trtdFinder;
var amt;

            if (rsLength > 0) {
                for (var i = 0; i < rsLength; i++) {
                    trFinder = $('#' + placeholder).find('[Id=' + (i + 1) + ']');
                    trtdFinder = $(trFinder).find('td')[1];
amt =recordset[i]["Primary Revenue Amount"];
var number = Number(amt.replace(/[^0-9\.]+/g,""));
                    if (number >= "2000000") {
                        $(trFinder).css('background-color', 'Red');
                    }
                }
            }
        }
        return OpptyListPR;
    }());

}

we have to update manifest and customer files with the above js names

Screen shot