I have a custom object (name: mediadata), I've stored some files in the different items at the custom object. How can I get the information about the files via query?
I use for attachments the query below, but it doesn't work for files.
List <mediadata__c> MDList = [SELECT Description__c, Topic__c, (SELECT Id FROM Attachments ) FROM Mediendata__c];
What is the structure from the files? I find something about the contentversion and ContentDocument but its not clear at the moment.
UPDATE
List <Mediadata__c> MediadataList = [SELECT Id, Description__c, Topic__c FROM Mediadata__c ];
FOR (Mediadata__c MSI : MSList) {
List <ContentDocumentLink> CDLList = [SELECT Id FROM ContentDocumentLink WHERE LinkedEntityId = :MSI.Id]; MSList.addAll(CDLList);
}
return MSList;
How can I combine my MediaDataList with the CDLList. Should I use a map?