- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2022 06:47 AM
How do I set the color for UI Action buttons?
I do not see an option for it on the UI Action.
I tried Client Scripts but I see 2 problems with them:
- They run before the page loads, so the button objects do not exist yet
- They do not have access to DOM, document or any object in the page.
I tried this solution and variants but nothing worked.
https://servicenowguru.com/scripting/client-scripts-scripting/change-form-button-color/
I always get this error when using console.log(e)
inside of catch(e){}
:TypeError: $$ is not a function
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2022 07:07 AM
Hi ,
You can change the colour from form style - to destructive(red) or green . If it not visible on your UI action form then first try to add the "form style" field from the form designer and then the field will be visible where you can change the colour
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2022 06:54 AM
Hi
No need of Client scripts if you just want to change the color of your UI Action button on the form...no client script in necessary. There's a field called "Form style" as seen in your screenshot and contains a few styles already OOB. One is "Destructive" which is red...so set your reject button to that style and that one is done.
For the Green version...you'd have to create that...please see this thread and specifically look for Chuck's response that gives details on how to add other colors: https://community.servicenow.com/community?id=community_question&sys_id=d2494725db5cdbc01dcaf3231f96...
Example :
UI Action for approve:
Mark my answer correct & Helpful, if Applicable.
Thanks,
Sandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2022 06:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2022 06:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2022 06:56 AM
I did Isolate the script and it didn't work.