Hide Preview icon on related list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2024 04:01 AM
I want to hide preview option in the related list. Something like below in scoped application table.
I tried some UI scripts in the community, didn't find the exact solution. Any help would be appreciated.
Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2024 10:08 AM
You could check below link.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2024 08:01 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2024 02:52 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2024 07:57 PM
Hi,
Found the solution for it.
Step #1 (To find the ID of the table)
Right click on the Preview Icon ==> Inspect like this
In this case, I would like to Hide the Task SLA Related List Preview icon. So just took the HTML Table ID of it and my id is "incident.task_sla.task_table".
Now, create a UI Script like this
Note: Cell[1] will be always a preview Icon. So you can have a hardcoded one.
(function() {
addAfterPageLoadedEvent(function() {
if ((window.location.href.indexOf('incident') != -1)) {
var table = document.getElementById("incident.task_sla.task_table");
for (var i = 0; i < table.rows.length; i++) {
table.rows[i].cells[1].style.display = "none";
}
}
});
})();
You are done and the final result is like this
Before#
After#
Thanks,
Narsing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2024 12:39 PM - edited 08-08-2024 04:05 PM
Reposting this reply. So I added a different related list to the form. The URL for the record I'm viewing that has the related list is as follows plus params for sysId etc added:
/now/nav/ui/classic/params/target/cmdb_ci_service.do
Now when I inspect the preview icon (screenshot below) on a row in that related list, the table id = cmdb_ci_service.kb_knowledge.cmdb_ci_table
So I used your script replacing incident with cmdb_ci_service and incident.task_sla.task_table with cmdb_ci_service.kb_knowledge.cmdb_ci_table. Here's the script:
(function() {
addAfterPageLoadedEvent(function() {
if ((window.location.href.indexOf('cmdb_ci_service') != -1)) {
var table = document.getElementById("cmdb_ci_service.kb_knowledge.cmdb_ci_table");
for (var i = 0; i < table.rows.length; i++) {
table.rows[i].cells[1].style.display = "none";
}
}
});
})();