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

Great suggestion Jim!! Gifs are classic and always cool!


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.