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
Bill Bell 3Bill Bell 3 

Files Object Name

Simple question.  On an Opportunity you can upload files.  I want to query the upload file object and check what files were uploaded.  What is the object name to query?  I've been looking for an hour and can't find it.
Lokesh KumarLokesh Kumar
Query Attachment Object ! 
Lokesh KumarLokesh Kumar
Sorry Please ignore the above reply.

You have to query ContentDocumentLink Object like in the below Article.
http://salesforce.stackexchange.com/questions/124640/how-to-query-all-files-attached-to-the-opportunity 

Thanks !
Lokesh
Bill Bell 3Bill Bell 3
I was able to get an Id using the article but what object do I query using the Id?  I need the file name and date it was uploaded.
Lokesh KumarLokesh Kumar
You can Query ContentDocumentLink Object.
Bill Bell 3Bill Bell 3
The only fields in ContentDocumentLink are id, linkedentityid, contentdocumentid, isdeleted, systemmodstamp, sharetype and visibility.  I don't see any object I can query.  Do you have an example?
ADixitADixit
You can use ContentDocument.Title and same for date in ContentDocument.CreateDate/LastModifiedDate/LastViewDate.
Scott CateyScott Catey
SImilar question, but for a custom object with a related files tab. where/how do i query for the particular file(s) related to a particular record on the custom object?
Anuj saini 8Anuj saini 8
You need to Query the ContentDocument for the files.
But if you want to query the linked related files in the files section, then you just need to fetch the contentDocumentLink where linkedEntityId is the ID of ContentDocumentId just to check which file is attached to which record.