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
sia thiripo 1sia thiripo 1 

how to get the list of .type(like ".pdf, .doc, .docx) files from all objects ?

Best Answer chosen by sia thiripo 1
sachinarorasfsachinarorasf
Hi Sia,

To get the list of all files from all sObjects you can use this query :

    Select Id,Title,ParentId, FileExtension from ContentDocument

To get the list of files from a specific sObject use this query :
        
    Select Id,LinkedEntityId,LinkedEntity.name,ContentDocumentId ,ContentDocument.title,ContentDocument.FileExtension from ContentDocumentLink 
        WHERE LinkedEntityId in (SELECT Id FROM Account)
        
You can refer the following link for more details on ContentDocument,ContentDocumentId,ContentDocumentLink : 
 https://blog.cloudanalogy.com/overview-of-content-version-content-document-and-content-document-link/
 https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contentdocument.htm
 https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contentversion.htm
 https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contentdocumentlink.htm


I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Sachin Arora
www.sachinsf.com

All Answers

AbhishekAbhishek (Salesforce Developers) 
You can try to export Attachments object via Data Loader with the following query:

select ID, Name
from Attachment


I made the soql query in my org and the result contains file names.

For further reference check the steps as mentioned in the below developer discussion,

https://trailblazers.salesforce.com/answers?id=9063A000000e9DaQAI

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.

Regards,
Salesforce Support.
 
Nathan GamerNathan Gamer
Thanks for this solution, I had this problem too.

Nathan from this page (https://nativecasinos.ca/online-casino/paypal). 
sachinarorasfsachinarorasf
Hi Sia,

To get the list of all files from all sObjects you can use this query :

    Select Id,Title,ParentId, FileExtension from ContentDocument

To get the list of files from a specific sObject use this query :
        
    Select Id,LinkedEntityId,LinkedEntity.name,ContentDocumentId ,ContentDocument.title,ContentDocument.FileExtension from ContentDocumentLink 
        WHERE LinkedEntityId in (SELECT Id FROM Account)
        
You can refer the following link for more details on ContentDocument,ContentDocumentId,ContentDocumentLink : 
 https://blog.cloudanalogy.com/overview-of-content-version-content-document-and-content-document-link/
 https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contentdocument.htm
 https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contentversion.htm
 https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contentdocumentlink.htm


I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Sachin Arora
www.sachinsf.com
This was selected as the best answer
Gabriel RamosGabriel Ramos
With this guide https://1x2apostas.pt/ you will have all the information you need to know the most diverse types of bets.
Steven SanchezSteven Sanchez
Casino gambling can be a way to release stress and earn money. We would like to invite you to visit our casino https://bestcasinosonlines.com/. Come meet.
Florence MclaiFlorence Mclai
The best bookmakers are those that offer great winning odds, a wide range of games and rewards for their loyal customers. The casino https://canadianbestcasino.com/ that offers high winning odds, a wide range of games and rewards to its loyal customers is Best Canadian Casino.