Ask Search:
Admin UserAdmin User 

How do I restrict certain users from using the Edit and Delete buttons of the Notes & Attachement Related List?

Best Answer chosen by Admin User
Narender SinghNarender Singh
Hi,
Refer to this post :https://developer.salesforce.com/forums/ForumsMain?id=9060G0000005dAz

I had helped someone with similar kind of requirement.

Let me know if you need any assistance.

Also kindly mark this post as solved by selecting a best answer.
Thanks!

All Answers

Narender SinghNarender Singh
Hi,
Unfortunately you cannot.

Workaround:
Remove the notes and attachments list from layout and create vf page to show the lists of related notes and attachment. And add that VF page to a section in the layout.
Admin UserAdmin User
Narender, thank you for your prompt response.
Any chance you can assist me with some instructions on how to create this Visualforce Page? I'm not a developer...
Narender SinghNarender Singh
Hi,
Refer to this post :https://developer.salesforce.com/forums/ForumsMain?id=9060G0000005dAz

I had helped someone with similar kind of requirement.

Let me know if you need any assistance.

Also kindly mark this post as solved by selecting a best answer.
Thanks!
This was selected as the best answer
Admin UserAdmin User
Should I change 'Contact' to 'Lead' on the sentence below?
<apex:page standardController="Contact" extensions="cls">
Admin UserAdmin User
Also, i get an error:
Error: Apex class 'cls' does not exist
Narender SinghNarender Singh
Hi,
 Use this code:
 
<apex:page standardController="Lead" tabStyle="Lead">
	<apex:form >
        <apex:pageBlock title="Notes and Attachments">
            <apex:pageBlockSection title="Notes" collapsible="false" columns="1" >
                    <apex:pageBlockTable title="Notes" value="{!Lead.Notes}" var="note">
                        <apex:column value="{!note.createddate}" width="120px"/>
                        <apex:column value="{!note.createdbyid}" width="120px"/>
                        <apex:column value="{!note.Title}" width="120px"/>
                        <apex:column value="{!note.body}" />
                    </apex:pageBlockTable>
             </apex:pageBlockSection>
             <apex:pageBlockSection title="Attachments" collapsible="false" columns="1" >
                    <apex:pageBlockTable title="Attachments" value="{!Lead.Attachments}" var="a">
                        <apex:column value="{!a.createddate}" width="120px"/>
                        <apex:column value="{!a.createdbyid}" width="120px"/>
                        <apex:column value="{!a.Name}" width="120px"/>
                        <apex:column value="{!a.ContentType}" width="120px" />
                        <apex:column >
                            <apex:outputLink value="/servlet/servlet.FileDownload?file={!a.id}" target="_blank" >View Attachment</apex:outputLink>
                        </apex:column>
                    </apex:pageBlockTable>
             </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>
Admin UserAdmin User
Thank you! it's perfect! YOCHAY ELIAZ CEO Title Loans Lender, CFL License 603F508 T: (818) 322-3393 | F: (818) 308-1396 W: www.montanacapital.com 12114 Sherman Way, North Hollywood, CA 91605 *Notice of Confidentiality:* This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify me by e-mail (by replying to this message) or telephone (noted above) and permanently delete the original and any copy of any e-mail and any printout thereof. Thank you for your cooperation with respect to this matter.
Narender SinghNarender Singh
Awesome!