- 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-11-2023 04:56 AM
We are using the above in desktop UI and not portal.Our requirement is at desktop side
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2023 06:25 AM
@Community Alums
The "h-card" class name is the HTML element for the comments / work_notes "cards" that show up within the activity log on the desktop UI. They do no have separate HTML elements for comments vs work_notes however you can determine if a given card element is a work_note if it has a "gold" style reference found in it.
Also you may be having issues with running the script due to strict mode where direct DOM is disable. If you have the system property "glide.script.block.client.globals" set to true, then you are running in strict mode and should set it to false. If you do not see that system property listed, then create a new system property with the following values:
Name: glide.script.block.client.globals
Type: True | False
Value: false
I hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2023 06:49 AM - edited 04-11-2023 07:03 AM
Hi,
I have made all the changes as mentioned above.
It seems to be working thanks. But it's also coloring the Notes and resolution field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2023 06:52 AM
@Community Alums
Can you provide a copy of the script you have currently implemented? I suspect you may be possibility calling the wrong HTML elements.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2023 07:10 AM