Flashing a field in the list view

SwarnadeepNandy
Mega Sage

Hi,

I am new to serviceNow. I was stuck in a problem. I want to flash a field in the list view of the table. The flashing will be based on, any update via email on a particular record.

I have tried a piece of simple javascript code in "Values" field in styles.

function initBlink()
{
   
var state = false;
  setInterval
(function()
   
{
  state
= !state;
   
var color = (state?'red':'green');
  document
.getElementById('test').style.color = color;
   
}, 1000);
}


Looking forward for your help.

1 ACCEPTED SOLUTION

epam
Kilo Guru

Hi, Swarnadeep.



If I understand your question properly, the incident is updated by inbound email actions.



So You can do following:



- the Inbound Email Actions script should mark the incident any way your prefer (e.g. current.comments = "incident was updated by email")



- As Berny Alvarado and Jim Coyne say: create a special style (using Field Styles) on a list based on a condition like this:



      javascript:current.comments.indexOf('updated by email') > 1



To create a flashing dot near some field (I tested it on Fuji): Upload an animated gif to System UI -> Images and write a field style like this:



      background:transparent url('flashing.gif') -20px -20px no-repeat;




- Create a List Button for incident table (System UI -> UI Action) with script like this:



function startReloadList(){


      location.reload();


}


setTimeout(function() { startReloadList(); }, 10000);



The script refreshes list every 10 seconds. Also You can insert "startReloadList()" into the onclick field to reload the list by the button.


View solution in original post

11 REPLIES 11

Andrii
Kilo Guru

Try to use UI Script instead.


Can you help me with a piece of code. Because i am not that handy with servicenow scripting. Thanx in advance.


What table are you talking exactly about?



I don't have much time ... but your task is interesting - I will think of it if nobody else will answer your question first.



What is necessary to do:



1) find out that incident was updated via email


2) tell this to script that highlights (may be via event)


Yes.


I need to flash the incident in the list view itself, whenever any incident is updated via email. No where I could find scripting for the list view.