Thursday, February 16, 2012

Remove Attachment Button From Attachment Related List in salesforce

Hi Guys ,
We can remove attach button from Notes And Attachment Related List from any object by creating a visualforce page.
Create a visualforce page RemoveAttachBTN with object standard controller .

<apex:page standardController="Account">       
<apex:relatedList list="NotesAndAttachments">
  <apex:facet name="header">&nbsp;</apex:facet>    <!--This line of code removing the attachment header-->        
 </apex:relatedList>
</apex:page>

https://ap1.visual.force.com/apex/RemoveAttachBTN?id=RecordIdofStandardController

Now go to the Edit Layout  of the record and add this visualforce page by creating any section , the only drawback is that this section would be between Standard Button of page layout . We can put visualforce just like related list of record.

2 comments:

  1. Its really very helpful,really nice one

    ReplyDelete
  2. Hello i'm getting error: 'NotesAndAttachments' is not a valid child relationship name for entity Account' Any solution?

    ReplyDelete