You need to sign in to do that
Don't have an account?
Luka Nićiforović
SOQL query to get related files and notes for an object
I'm trying to get related Files and Notes of objects in Salesforce, this is the UI representation of what I want to get:
So far I've tried these queries:
SELECT Id FROM Attachment WHERE ParentId='{objectId}'
SELECT Id FROM Note WHERE ParentId='{objectId}'
But the results are empty arrays..
Does anyone know a way to get this data, at least the count of related files and notes?
Try this:
[SELECT Id, LinkedEntityId, ContentDocumentId,Visibility, IsDeleted, ShareType,ContentDocument.Title,ContentDocument.createdDate, ContentDocument.FileType FROM ContentDocumentLink WHERE LinkedEntityId =:parentIds];