Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Approvals buttons like approve or reject button not showing Green or red color?

ch_naresh207
Giga Expert

Can we have the approval buttons coloured like they currently are in production?

Fuji:

find_real_file.png

Calgary:

find_real_file.png

I think the red and the different green helps see the right option. There is a tendency to click the update button by mistake when they are all dark green.

#

Please help me Fuji also we need different colors.

1 ACCEPTED SOLUTION

syedfarhan
Kilo Sage

Hi Naresh ,



Try this


You can use this script in an 'onLoad' client script on the table of your choice. This example should be used on the 'Approval' table.



function onLoad() {


    //Change the color of the 'Approve' button to green


    changeButtonColor('approve', '#00CC00');


    //Change the color of the 'Reject' button to red


    changeButtonColor('reject', '#CC0000');


}




function changeButtonColor(buttonID, backgroundColor) {


    try{


          //Find the button(s) by ID and change the background color


          $$('button[id=' + buttonID + ']').each(function(elmt) {


                elmt.style.backgroundColor = backgroundColor;


                elmt.style.color = '#ffffff'; //make the button text white


          });


    }catch(e){}


}



Ref: Change the Color of Form Buttons - ServiceNow Guru   for more details




Thanks


View solution in original post

9 REPLIES 9

Thank you all,



I need 1 more help,



How to change Title bar colour?



Please find the below snapshot as round mark.


find_real_file.png


I need help how to change update color and delete color


Hi Naresh ,



If you want to change the title bar color then goto -->system UI-->UI script click create new .


check the global checkbox true.



add this script:



try {


  addLateLoadEvent(changeListBackground);


} catch (e){}





function changeListBackground(){


  gel('list_nav_incident').style.backgroundColor = "blue";


}



Untitled.png




Thanks


ch_naresh207
Giga Expert

I tried in my dev instance but its not working.



My instance have 3 domains like global ,top   wealth eroupe



Which domain write to the above code


Naresh,



You should write in Global. I tried and It's working for me.   I have added the script of incident   form , However you change the field like



gel('list_nav_incident').style.backgroundColor = "blue";//incident


gel('list_nav_problem').style.backgroundColor = "blue";//problem




Thanks