Additional info message showing in list view when user is trying to edit columns in list view

Debashish Paul
Tera Guru

Requirement:

  1. Display an info message only in a list view in a 'Problem' table that should contain 'Last Refreshed Time' and 'Next refresh time' this info message should get updated in an interval of 10 minutes - Am able to achieve this requirement using business rule and UI action
  2. Problem currently facing: An additional info message is showing when user is trying to change value in list view, when clicked on cell.

    Need to restrict/stop showing this 'additional info message' in the list view. Have also attached the screenshots below
    I have highlighted the info messages in Red color that needs to be restricted.
    DebashishPaul_0-1724843114432.png

     

    Business Rule: using Before - Insert, Update and Query 
    script:
     

 

 

 

 

(function executeRule(current, previous /*null when async*/ ) {
    
    var index = gs.action.getGlideURI().toString().indexOf('problem_list');
    if (index > -1) {
        var gdt = new GlideDateTime(); //uses current user session time zone (US/Pacific)
        var usrDateTime = gdt.getDisplayValue();
        var lastRef = usrDateTime.toString().split(" ");
        var addSec = new GlideDateTime();
        addSec.setValue(usrDateTime);
        addSec.addSeconds(600); //10 mins. refresh interval
        var nextRefresh = addSec.toString().split(" ");
        nextRefresh = nextRefresh[1];
        gs.clearMessages();
        gs.addInfoMessage('<b> Last refreshed on: </b>' + lastRef[1] + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b> Next refresh Time: </b>' + nextRefresh);
    }
})(current, previous);

 

 

 

 


DebashishPaul_1-1724843346610.png

 

 

Need help to fix this asap. Thanks
Regards,
Debashish


2 REPLIES 2

GlideFather
Tera Patron

Hi,
have you tried to change the BR onAfter and for Update only?

Not on query and not on insert, as it is relevant to updating the data, so the insert is not needed, as you do not create records in list view...

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Hi @GlideFather Tried this approach as well, it doesn't shows any info message in the lists, which is impacting my requirement 1.