How to change the color of the user added worknotes in the activity

Community Alums
Not applicable

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

Ankur20_0-1680877613873.png

 

2 ACCEPTED SOLUTIONS

@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]);  
		}
	}
}

 

View solution in original post

@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. 

DomGattuso_0-1681223415506.png

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?

View solution in original post

14 REPLIES 14

@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. 

DomGattuso_0-1681223415506.png

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?

Community Alums
Not applicable

Grea88 thanks its resolved now..

There was one more client script written on load which was causing the issue.

Community Alums
Not applicable

@Dom Gattuso  Actually I am writing this on task table so that this can be applied to all the tables that are extended.Now there is a table called Order Task(sn_ind_tmt_orm_order_task) , Here System work notes are also of 'Gold' color therefore our script is also updating that color as well to red

 

Actually that means the below condition  is not working

If (div1[i].innerHTML.indexOf('System') != -1)

Ankur20_0-1681304863330.png

 

@Community Alums - Since you are doing it on the task table, please ensure you have selected the inherited checkbox on the client script: 

DomGattuso_0-1681306411638.png

This will allow it to run on all task extended tables. 

Community Alums
Not applicable

@Dom Gattuso This is working fine now but we have come across an issue wherein the hyperlink is not getting pasted on worknotes.Its getting disappeared I wrote onLoad client script to write the below code:

 

function onLoad() {

    var div1 = document.getElementsByClassName('h-card');
    for (var i = 0; i < div1.length; i++) {
        if (div1[i].innerHTML.indexOf('System') == -1) {
            var html = div1[i].innerHTML;
            html = html.replace(/gold/g, "blue");
            div1[i].innerHTML = html;

        }
    }


}