We have a custom object.
In the notes and attachments related list of this custom object we have uploaded few pdf and ms-word files (each of them of size < 5 mb)
we are not able to access the attachments by soql query inside apex class.
Further even in workbench a simple query 'SELECT Id, Name FROM Attachment'
returns 0 records.
Best Answer
In Spring'16 release Salesforce introduced
Files uploaded to the Attachments related list on records are uploaded as Salesforce Files, not as attachments
in Salesforce Files Settings:The following SOQL query would allow you to get Ids of Files (Attachments) and New Notes related to the record
SELECT ContentDocumentId,Id,LinkedEntityId,ShareType FROM ContentDocumentLink WHERE LinkedEntityId = 'YourRecordId'