- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2023 07:27 AM
Hi Team,
There is a requirement to change the color of user added worknotes to blue or any other color. So that it can be easily identified which is added as system notes and which is added as user notes
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 08:00 AM - edited 04-10-2023 08:32 AM
@Community Alums
While its not ideal to run DOM, you could use an onload client script to do it:
function onLoad() {
var divs = document.getElementsByClassName('h-card');
for(var i = 0; i < divs.length; i++){
if(divs[i].innerHTML.indexOf('System') != -1){
var html = divs[i].innerHTML;
html = html.replace(/gold/g, "red");
divs[i].innerHTML = html;
//console.log(divs[i]);
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2023 07:31 AM
@Community Alums
I would change it back to "h-card" since the "h-card-wrapper" will update all cards with gold if any "system" text is found within all cards. Here is what I get when I use "h-card" class name reference.
I am not sure why the notes tab is getting changed to red as well for you, that does not occur for me 🤔 does you notes table have the gold color in it by chance?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2023 08:03 AM
I don't think there is a way to dynamically change the color based on conditions. I do know the color is set through a system property called "Glide.ui.activity_stream.style.work_notes", if that helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 04:44 AM
There should be someway? Can we write any script to achieve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 08:00 AM - edited 04-10-2023 08:32 AM
@Community Alums
While its not ideal to run DOM, you could use an onload client script to do it:
function onLoad() {
var divs = document.getElementsByClassName('h-card');
for(var i = 0; i < divs.length; i++){
if(divs[i].innerHTML.indexOf('System') != -1){
var html = divs[i].innerHTML;
html = html.replace(/gold/g, "red");
divs[i].innerHTML = html;
//console.log(divs[i]);
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 11:51 PM - edited 04-11-2023 04:14 AM
What is 'h-card' ?
I tried to run the above code but its not working. I can see you are replacing 'gold' with red, How to get worknotes ?