Find your content:

Search form

You are here

Copy or Link the Chatter Post Files into Library

 
Share

I was wondering, is there any way to link the Chatter Post File into a specific Library and make it published?


Attribution to: Praveen Ramachandra

Possible Suggestion/Solution #1

After you created a Feed on Chatter with a file attached, you get an object of the type FeedItem with Type="ContentPost". There is another field which is called "RelatedRecordId" and points to a record of type "ContentVersion". This is a version of the file that is stored in Salesforce.

If you would like to share this document afterwards with other users, groups or even libraries, you need to create additional records of the type "ContentDocumentLink", and point the field "ContentDocumentId" towards the "ContentDocumentId" of the related ContentVersion from your FeedItem and "LinkedEntityId" towards the content library. See the link for further fields and options.


Attribution to: Nisse Knudsen

Possible Suggestion/Solution #2

Why yes you can! The file information is stored in the FeedItem object where Type = ContentFile.

You can query something like this:

SELECT ContentData,ContentDescription,ContentFileName,ContentSize,ContentType FROM FeedItem WHERE Type = 'ContentPost'

Note that any query involving binary data (ContentData) can only be queried one row at a time, so you will need to know the specific post you are looking for when you query.

Also note that there is no "God Mode" when it comes to Chatter / Content files, so if you don't have view access to the file, you will never be able to access it, even if you are admin.

Then you can transfer that information to a ContentDocument and ContentVersion object for the file itself, and the ContentWorkspace and ContentWorkspaceDoc object for the library connection.

Check out the documentation on those objects here for help:


Attribution to: Scott VonSchilling
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/4486

My Block Status

My Block Content