- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2020 03:07 PM
I'm currently trying to prevent image attachments from appearing as thumbnails in the activity log.
The thumbnails should be visible when the image is attached, but after a certain field on the form is toggled, a user should no longer be able to see the thumbnails in the activity log. The user should still be able to view the attachments from the attachment related list or the list located in the header, I'm just trying to prevent that thumbnail from appearing.
I thought that all of the records in the activity log were stored in the sys_history_line table, but it seems that attachments don't show up there?
Solved! Go to Solution.
- Labels:
-
Customer Service Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2020 07:21 AM
I found a solution. Originally I wanted to do this in a UI Macro/Formatter, but it kept breaking our form page.
I created an onLoad client script that finds the HTML elements on the page that display the thumbnail images. I then hide those elements, if certain conditions are met, and add a line of text in their place that notifies the user that the thumbnail was hidden.
It seems to work well enough.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2020 12:55 PM
Hi Vinoth, here is what I ended up doing in my onLoad client script:
var class_str = 'sn-card-component sn-card-component_attachment state-selectable';
var elems = document.getElementsByClassName(class_str);
var i;
for (i = 0; i < elems.length; i++) {
var node = document.createElement("DIV");
var text = document.createTextNode("** This image has been hidden **");
node.appendChild(text);
var parent = elems[i].parentElement;
elems[i].style.display = "none";
parent.appendChild(node);
}
It's not particularly pretty, but basically all I'm doing is looking up the HTML element that contains the attachment link, disabling all of it's children, and adding my own text element as a new child.
In order to enable DOM manipulation like this for client scripts, you must set the "Isolate Script" field on the client script form to false. By default this field is not visible on the form view so you'll have to add it.
It's worth pointing out that you can completely break the form view if you're not careful, so you should only use DOM manipulation as a last resort.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2024 06:17 AM
Hi, select "Attachments" on field "filter actity" and resolved.
Consultor certificado y especializado en la consultorÃa del producto.