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
Harish GAADE 2Harish GAADE 2 

how to disable or hide the notes & attachment upload file button on related list of parent object

Hi All,
I am not able to finish this requriment can any on help on this 

my requriment is user should not upload files through Notes &attachments which is in related list of parent object it because user only  attach document at the time  parent record is created so we have created lighting component for uploading the documents but user can upload the document in related lsit we don't wanted allow the users to upload.
can any one give me the suggestion how to achive this requirment/complete .
Or any one done this requriment
but i tried to through trigger through error message on related list page but it is not happening are we can't achive through trigger can any on help
User-added image
Best Answer chosen by Harish GAADE 2
Watts JonasWatts Jonas
I think there is no supported way to hide only the document attachment button YourTexasBenefits (https://www.yourtexasbenefits.me/). 

All Answers

Khan AnasKhan Anas (Salesforce Developers) 
Hi Harish,

Greetings to you!

The Notes & Attachments related list is a standard list that is not customizable therefore you would not be able to remove the button. However, you can remove the standard "notes and attachment" related list from the layout of the child and create a visualforce page that will list all the files, without any upload File button.

Try something like this:
<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>

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
Watts JonasWatts Jonas
I think there is no supported way to hide only the document attachment button YourTexasBenefits (https://www.yourtexasbenefits.me/). 
This was selected as the best answer
Harish GAADE 2Harish GAADE 2
Hi khan,
Can you please let know how to use it on custom object  so i can hide the header.
Thank you for the help