Change UI action button color

farci
Mega Expert

Hi,

I am struggling here to change the UI action button color to green when the button name is Approve and Red for button with name Reject.

Change the Color of Form Buttons - ServiceNow Guru

I also looked at the above link but to no avail.

You quickest response on this is appreciated.

Regards,

Narmi

1 ACCEPTED SOLUTION

You should be all set now. I went in and added a console.log statement inside of your "catch". This gave me the information that jquery was inaccessible, which in a scoped app it is not by default. (Scoped Applications and Client Scripts: A Primer )



I created a system property for you "x_69534_superduper.glide.script.block.client.globals" which enables this. (ServiceNow )



I disabled all of the alerts and the timeout that were set through testing and everything seems to work now.


View solution in original post

25 REPLIES 25

You should be all set now. I went in and added a console.log statement inside of your "catch". This gave me the information that jquery was inaccessible, which in a scoped app it is not by default. (Scoped Applications and Client Scripts: A Primer )



I created a system property for you "x_69534_superduper.glide.script.block.client.globals" which enables this. (ServiceNow )



I disabled all of the alerts and the timeout that were set through testing and everything seems to work now.


Hi Alex,



Thank You so much for your help, I am going to replicate it in my development instance.



Regards,


Imran


Also, please change your password for your dev site. Wouldn't want some jokester putting pictures of David Hasehoff as your logo.


HI narmi


Right click on page>inspect->and find you UI button there


Copy Id attribute from button element.


and then pass that element ID


find_real_file.png



Thanks


terp
Giga Contributor

You could create two buttons one approve and one reject with different colors and then create a condition based UI action to show the button you want.     Create a UI Action for each button, make sure that you have the correct Action name listed that will reference your color button.  


Create a condition to "show" the button you want to for example    



UI Action: Approve


Name: Approve


Action Name:   approve.anyname


Condition: current.state==19


Script:



current.approval = "approved"


Current.update();