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
Claire JonesClaire Jones 

add Attachments related list to Event edit visualforce page

I have a visualforce page which overrides the Task and Events Edit page.

The business requested I add Attachments to this page, so I added the related list to the standard view page - but add attachment button not visible.

I read into the situation and discovered that the button is only visible in Edit mode, so I also added it to my visualforce edit page ( <apex:relatedlist list="Attachments" />) - but again the add attachment button is not visible.

What do I need to do so that the add attachment button is visible on my edit task visualforce page?

Thanks in advance for any help.
Best Answer chosen by Claire Jones
Synthia B.Synthia B.
Hi Claire, 

I think this what you're looking for. 

http://blog.jeffdouglas.com/2010/04/28/uploading-an-attachment-using-visualforce-and-a-custom-controller/

Or

http://developer.force.com/cookbook/recipe/uploading-a-document-using-visualforce-and-a-custom-controller

All Answers

Chandra Sekhar CH N VChandra Sekhar CH N V
Hi Claire, 

I hope you are referring here to standard 'Notes & Attachments' related list to the object. 


Attachmentrs inherits permissions from the related object. Example -  In case a user has "Read/Write" permissions on the Account, he/she will be able to modify the note/attachments. Similarly, if the user has "Read Only" permissions on the Account, he/she will only be able to read the notes/attachments and not add new/modify existing ones.

Hope the above clarifies what you were looking for.
Claire JonesClaire Jones
Hi Chandra

Thanks for replying. Yes, it is the standard 'Notes & Attachments' related  list.

I understand about attachments inheriting permissions from the related object. As the related object is Tasks/Events, this too inherits permission from the related object.

I am testing this as System Admin, and therefore have read/write permission to all objects. However the add attachments button is not on the related list.

When I remove the Visualforce override of the edit button and switch back to standard page layout the 'add attachments' button is present. But it is not on my visualforce page.

I need to understand why i cannot see it in visualforce but can on standard layout. Thanks
Synthia B.Synthia B.
Hi Claire, 

I think this what you're looking for. 

http://blog.jeffdouglas.com/2010/04/28/uploading-an-attachment-using-visualforce-and-a-custom-controller/

Or

http://developer.force.com/cookbook/recipe/uploading-a-document-using-visualforce-and-a-custom-controller
This was selected as the best answer
Claire JonesClaire Jones
Thanks Synthia - think these articles are exactly what i need.