Hide Preview icon on related list

Naga Ravindra R
Kilo Sage

I want to hide preview option in the related list. Something like below in scoped application table.

 

NagaRavindraR_0-1715770788169.png

 

I tried some UI scripts in the community, didn't find the exact solution. Any help would be appreciated.

Thank you

 

11 REPLIES 11

Its working for me.  

Screenshot 2024-08-21 062348.png

Can you check this

  • When it comes to the Service table, it may be application service /technical service / business service/offering tables if you have CSDM.  So in your condition, use something like this as mentioned in the below script.
  • Also, please make sure to use ".do" in your condition, otherwise, it applies to List view of the service table and people will not be able to personalize list view.

Screenshot 2024-08-21 063728.png

 

(function() {
    addAfterPageLoadedEvent(function() {
        if ((window.location.href.indexOf('cmdb_ci_service.do') != -1 || window.location.href.indexOf('cmdb_ci_service_auto.do') != -1)) { //Add the remaining classes as well
            var table = document.getElementById("cmdb_ci_service.kb_knowledge.cmdb_ci_table"); // check if the element id is the same for application service/technical service etc.,
            for (var i = 0; i < table.rows.length; i++) {
                table.rows[i].cells[1].style.display = "none";
            }
        }
    });
})();

Narsing1_0-1724203069912.png

 

 

Thanks,

Narsing

 

Adding .do on the table name worked.  Thank you!!

 

if ((window.location.href.indexOf('cmdb_ci_service.do')