I am doing analysis to get the number of files attached to the each object inside Salesforce. I found that there is a standard object named ContentDocumentLink which has the reference of the each file(i.e. LinkedEntityId field maps the file with the corresponding object). I have tried the approaches listed below but I didn't get the expected result :
- I have tried to export all the ContentDocumentLink records using Dataloader. But there is a query limitation on the ContentDocumentLink object,it looks like we must provide the LinkedEntityId or ContentDocumentId in filter to export a data. Since I want to get the count of files by grouping the objects from ContentDocumentLink, I cannot specify any objects in my filter as In would require data of every object that has a file attached to their record.
- I have tried to export using Data Export option in Setup. I have scheduled this export 8 days ago. But so far it shows that 'Your export has been queued'. I don't know how this got stuck or not and when it will be completed.
Apart from the above methods, do anyone have a solution to calculate the No of files present in each object based records. (Eg: Account - 3000 Files Attached Contact - 2000 files Attached Opportunity - 1500 files Attached, Etc)