1

I am trying to be able to download a file blob attached to a Case. I was first looking on the attachments table for the id of the file and realized it wasn't there and it was in ContentDocument. The problem I have is that I don't see a method to get the blob like attachment (please tell me I am wrong).

My real question is, how does salesforce decide what is on the Attachment object and what goes to the ContentDocument object?

EDIT: To clarify, my confusion is that I had attached a file to a case under the notes/attachments section. When I went to look for it with SOQL it ended up being in the ContentDocument schema and not the Attachments schema like I would think it would go to.

closed as too broad by Raul, battery.cord, Basti, Martin Lezer, Himanshu Feb 2 '18 at 18:51

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

2

Attachments are being deprecated in favor of using Files.

The ContentDocument object represents a document that has been uploaded to a library in Salesforce CRM Content or Salesforce Files.

https://help.salesforce.com/articleView?id=Consideration-for-enhanced-notes-and-using-Files

There's a preference included in the Spring '16 rollout of the enhanced notes tool which describes the change in behavior.

To help facilitate the change over to Files from Notes & Attachments a new preference, "Files uploaded to the Attachments related list on records are uploaded as Salesforce Files, not as attachments" has been introduced to ensure that Attachments added via the legacy Notes & Attachments related list are now uploaded as Files moving forward. It is recommended that administrators for orgs created prior Spring '16 enable this feature and for more details see the Upload Files to Notes & Attachments List in Salesforce Classic section of the Spring '16 release notes.

One of the community-created migration tools to get binary content out of Attachments or Notes and into Files and Enhanced Notes:

https://douglascayers.com/2015/10/10/salesforce-convert-attachments-to-chatter-files/

Not the answer you're looking for? Browse other questions tagged or ask your own question.