function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RDM1961RDM1961 

Display read only version of Attachment related list on standard page layout

Hello,
First I should mention I have very little VF/APEX experience. I've done a lot of configuration but little/no development.

We have a need to display a list of attachments related to a custom object in read-only mode. Users need to be able to edit some fields on the parent object but not have the ability to add/delete attachments. I tried to do this by adding a visual force page on our standard page. 

Visualforce Page:
<apex:page standardController="Customer_Support__c"> +
<style type="text/css">
.actionColumn {display:none; visibility:hidden}
</style>
<apex:relatedList list="CombinedAttachments">
<apex:facet name="header"><center><b></b></center></apex:facet>
</apex:relatedList>
</apex:page>
 
This works but has a couple major issues:
  1. The inserted page does not auto-size or allow scrolling so if there are a lot of attachments not all are visible.
  2. Clicking an attachment link opens the attachment detail page inside of the inserted page with obviously poor results.
​​User-added image

User-added image

After a little research, I see that I can't use 'open in new tab' functionality with 'apex:relatedlist'. I thought about creating a custom controller but found it's then not available when customizing a page. 

How can I include a view only list of attachments that works without moving to all Visualforce pages? 

Thanks,
Rick