is it possible to show files that are linked to a detail record on the master record?

For example, I have an account__c record (AccountA) and a contact__c record (contactA), I attach a file to ContactA and I want to be able to see the file in the related list of files on the master record (Account A)

  • It is possible by adding custom VF page which will have attachments list and add it to your master record by editing the page layout. Commented Feb 21, 2017 at 10:26

3 Answers 3


You need a Trigger on ContentDocumentLink:

To customize file sharing behavior, define an Apex trigger for the ContentDistribution or ContentDocumentLink objects. The ContentDistribution object represents a file shared externally. A ContentDocumentLink represents a file shared with an internal object, such as a user, group, or record.


Use a trigger on attachment to populate a junction object linking the Contact's account and the attachment. Put this related list on the page layout. You'll have two related list: Attachments and "Child Attachments".

You could link the account's attachment with the junction object as well and keep only one related list, but then you would have to create a custom button in order to create attachments on the account.


Use a custom visualforce page to query all attachments of child records and assemble a pageblockTable and embed this visualforce page on the page layout.

  • Same thing I said in my comment Commented Feb 21, 2017 at 10:42
  • oh. That's true. Create an answer and then I'll delete this one =D Commented Feb 21, 2017 at 10:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .