Change the field style (in list view and form view) when new work note has been added

Kasia5
Tera Contributor

Hi All,

My requirement is to:

1. I am a user and I open the existing incident, I need to update this one so I add the work note.

2. User ABC is working on this incident = is assigned to this inident, but he need a clear information that sth has been updated in this incident.

3. When he open the list view of incidents then he can see that number of incident which has been updated became bold and red - thanks to that he knows tha sth changed and he needs to check this incident:

4. When he opens this incident he still can see that number is red and bold.

5. He checks everything and came back to list view of all of incident.

6. Now number of this incident is again not bold and black.

 

I've created:

1. New field 'u_needs_attention' in 'incident' table:

2. A 'before' business rule to set field 'number' red and bold as below:

(function executeRule(current, previous /*null when async*/ ) {
 
        if (current.work_notes.changes() || current.comment.changes()) {
            current.setValue('u_needs_attention', true);
        } else {
            current.setValue('u_needs_attention', false);
        }
        
})(current, previous);
 
3. A field style as below:
 
 
It works but the problem is:
1. When I add the work note to INC123, then in list view field 'number' is red and bold but for all of the records...
2. When I opened the INC123 and came back to list view, then field 'number' is still red and bold....
 
Any idea how to achieve scenario from the beginning?
 
Thanks in advance for help!

 

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

if you are using field style then did you give correct condition to be checked in the Value field?

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

I am using:

javascript: current.u_needs_attention=true;

Hi,

it should be this

javascript: current.u_needs_attention.toString() == 'true';

regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Mark Manders
Mega Patron

The images are broken. Can you upload them as attachments? That helps in understanding the issue.

If my answer helped you in any way, please then mark it as helpful.

Mark


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark