How to apply different colors to UI action background/border on incident form

krishna115
Tera Contributor

Hi All,

 

I'm trying to change UI action color, there are two OBB colors providing by ServiceNow by selecting value (Primary/Destructive) in "form style" field on UI action (sys_ui_action) table. I have tried with UI Macro (sys_ui_macro) but there is no luck. Can any help me on this, below is the code.

 

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
    <style>
        #update {
            background-color: red;
            color: white;
        }
    </style>
</j:jelly>

 

Thanks

3 REPLIES 3

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @krishna115 

I recommend staying OOTB (Out of the Box) as it’s beneficial and helps reduce technical debt.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

@krishna115 

I agree from 100 %.

 

This might and most likely will be evaluated as a conflict during the first upgrade, even thought with low impact but still, it is a conflict that could have been avoided.

 

If you are fine with applying the same colour logics on the whole instance and not just this one button, then you can apply alternative theme, we had green-ish for DEV, yellow-ish for TEST, and blue-ish for PROD and it was everything - the banners, the menus, the buttons, etc.

But doing it just for one field is not a good idea and it will be more pain than gain.

Or do you have any specific business justification for that?

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Nikhil Bajaj9
Giga Sage

Hi @krishna115 ,

 

Please check this link- https://www.servicenow.com/community/developer-forum/setting-ui-action-color/m-p/1819677

 

Regards,

Nikhil Bajaj

Please appreciate my efforts, help and support extended to you by clicking on – “Accept as Solution”; button under my answer. It will motivate me to help others as well.
Regards,
Nikhil Bajaj