+ Start a Discussion

Users can delete attachments from closed opportunities

What is the best way of preventing this?


The problem is that f.ex.  a sales rep can remove/replace previously attached quotes or other attachments from an opportunity after it has been closed.


The opportunity itself is locked for editing, so it seems this should apply to attachments too.

The permission to delete Notes and Attachments is tied to the Edit permission on the record itself. If you have one, you will have the other. A Workaround to this would be to create a Visualforce page that displays the Notes and Attachment related list, but without displaying the delete link to the Notes and Attachment records. Another option would be to create a Trigger that would prevent the deletion of the Notes and Attachment records. There is an AppExchange package that addresses this very issue. Please follow this link here;

Please note that the Package is not created by Salesforce.com and we do not provide any support for it.
Message Edited by JorgeSFDC on 05-13-2009 04:56 PM

I am also trying to do the same thing. I need to remove the Delete and Edit links appearing on the Opportunity Products (OpportunityLineItem) on the Opportunity page.


Once our Opportunities are closed we need to prevent any edit/delete of opportunity products. We have managed to achieve this through permissions and validation, but the restriction is only apparent once you try and save your changes, or click delete. We would like to prevent the edit/delete links from appearing at all in the related list on the opportunity.


I've checked and this is not what happens by removing delete/edit privileges on Opportunity or Product. Any ideas? 


Hi, Jorge, I installed your attachment saver. I think it is a good start. (in my org, we dont want the opportunity owner to delete attachment uploaded by other users, but he can delete attachments uploaded by himself).


Also on the VF page for the related list, I think you can hide the delete link in the list, but if the user open the attachment detail page, they can still click the delete button there. And it looks like the detail page of attachment is not customizable thus you cannot remove the delete button from the page layout.