Custom Comments and Work Notes Field - background colour

Pedro Silva4
Kilo Guru

Hi guys,

I was wondering if its possible to customize only the background colour for the work notes in this list:

Field name:

find_real_file.png

I have managed to find the properties list:
find_real_file.png

Also created new style:

find_real_file.png

... however, nothing seems to work.. I just want to change the background colour of the work notes, but I guess because its a Journal List, probably it works in a different way?

do I have to write some script for that??

EDIT:

This is the field I want to change:
find_real_file.png

Its NOT for comments and work notes separately.. This is a out of the box field and it just shows the comments and work notes nicely

Thanks,

Pedro

14 REPLIES 14

Hi Rushit,




thanks a lot for your reply.



However those are not the fields I mean.



I am refering to the out of the box
find_real_file.png



This basically this is an array that joins both comments and work notes in a list, and just prints it nicely like this:



find_real_file.png





but its just a little difficult to see the difference between work notes and comments... So I just want to make work notes stand out.




Any other ideias?



thanks,


Pedro


Milan Kr_m__
Tera Contributor

Hi, I am looking for the same. Did someone find result? 🙂

I found result. Only way how to modify style of field in activities is in System Properties (add new record glide.ui.activity_stream.style.[field name] ) with color string on left side of field.

 

find_real_file.png

Note from Product doumentation:

Field styles are not applied to comments and work notes fields used with the activity formatter. Styles for these fields can be set using the glide.ui.activity_stream.style.comments and glide.ui.activity_stream.style.work_notes system properties located on the sys_properties table.

Liaqat Naveed
Giga Contributor

Thanks for Help

Sonali

Ivan Betev
Mega Sage
Mega Sage

Found a way that worked in my case. It requires an onLoad client script and manipulates the DOM (which is bad as we all now). Maybe this will help someone... 

 

/* Get all elements with the <sup> tag */
var supElements = document.getElementsByTagName("sup");

/* Loop through the <sup> elements */
for (var i = 0; i < supElements.length; i++) {
    var supElement = supElements[i];

    /* Check if the text content of the <sup> element matches the desired text */
    if (supElement.textContent.trim() === "Work notes") {
        /* The supElement contains the text "Work notes" */
        /* You can access the parent <div> element */
        var parentDiv = supElement.closest("div"); /* Find the closest ancestor <div> element */

        if (parentDiv) {
            /* Find the next sibling <div> element */
            var nextSiblingDiv = parentDiv.nextElementSibling;

            if (nextSiblingDiv && nextSiblingDiv.tagName.toLowerCase() === "div") {
                /* Check if the next sibling is a <div> element */
                /* You can apply changes to the next <div> here */
                /* Change the comment header background. Uncomment if needed. */
                // parentDiv.style.backgroundColor = "#f2e4ff"; 
                /* Change the text background */
                nextSiblingDiv.style.backgroundColor = "#f2e4ff"; 
            }
        }
    }
}