In Release Notes winter 16; Files Related List to the record is available.Refer to here .Where those files are stored?Is it inside ContentDocument?I wondering is there any other way for to view all files that related to the record .For example click search Account Name in Content page ; all related files to the account display.Or other option ; I want to view Files Related List in separate page.

If this features are not available , is it possible for me to develop it?Which object I should use?


The link seems to be referring to the Lightning Experience. This is not in Classic.

If you want to develop it, you can query the Document object and the Attachment object.

So you can retrieve the files and display them in a VF page.

Setup your files:

1) Create Documents putting the Account ID in the Name field so you can relate them to a specific Account.

2) Add Attachments to the same Account.

Retrieve your files:

1) You can query the Attachment object and get all attachments related to the specific record.

Sample code: List<Attachment> allAttachments = [Select ID, ParentID, body, Name from Attachment Where ParentID = 'Some SF Account ID'];

Query the Document object for document with the name containing the Account ID Here is a SOQL query of the Document object. You can use the fields you need from it.

Sample Code:

SELECT AuthorId,Body,BodyLength,ContentType,CreatedById,CreatedDate,Description,DeveloperName,FolderId,Id,IsDeleted,IsInternalUseOnly,IsPublic,Keywords,LastModifiedById,LastModifiedDate,LastReferencedDate,LastViewedDate,Name,NamespacePrefix,SystemModstamp,Type,Url FROM Document Where Name LIKE '%Some SF Account ID%'];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.