- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2018 04:57 AM
Hello there,
I'm new to the community and I want to customize the color of the form header and the list header. I found a Script on SN Guru but it dosen't work.
function onLoad() {
//Change the color of all form section headers
var backgroundColor = 'red';
$$('.navbar').each(function(elmt) {
elmt.style.backgroundColor = backgroundColor;
});
}
Thanks in advance
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2018 11:16 PM
Hi,
Then in that case have it in a UI script. Can you try this and check once. I tested and it is working fine for all table form headers
Ensure global is set to true for UI script
Something similar to this
(function() {
addAfterPageLoadedEvent(function () {
var backgroundColor = 'red';
$$('.navbar').each(function(elmt) {
elmt.style.backgroundColor = backgroundColor;
});
});
})();
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2018 05:05 AM
Hi,
it is working in my instance. What error you are getting in browser console?
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2018 06:20 AM
So I made some progress. I discoverd that you need to create a system property before your client script will work, with glide.script.block.client.globals = false. That ist nice but it change the color only for one Form at a time.
Maybe some of you guyes know a way to make a globale change, so that every List an Form Header are the color i want them to be.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2018 11:16 PM
Hi,
Then in that case have it in a UI script. Can you try this and check once. I tested and it is working fine for all table form headers
Ensure global is set to true for UI script
Something similar to this
(function() {
addAfterPageLoadedEvent(function () {
var backgroundColor = 'red';
$$('.navbar').each(function(elmt) {
elmt.style.backgroundColor = backgroundColor;
});
});
})();
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader