• Amora
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

I am trying to transfer Chatter posts from one instance to another.  I am running into problems moving attached files within comments (FeedComment items).

 

I realize that the files attach to comments via the RelatedRecordId (mapped to the ContentVersion object) and I am trying to transfer the file by:

1. Get the VersionData from the ContentVersion that is attached to the comment

2. Create the file on the destination environment by writing the file to disk locally and setting the VersionData, PathOnClient (linked to the file that was just created locally), Description, Title

3. Get the ID of the newly created ContentVersion object (returned by the SaveResult array)

4. Set the FeedComment's RelatedRecordID to the new ID created in step 3

5. Upload the comment

 

The result is the comment is created but the file is not found, resulting in "The file is no longer available.".  Am I missing a step in the file linking?

 

 

Note: My file creation process is similar to this - if there is a way to upload a ContentVersion file without creating it locally, I'd happily check that out.

  • September 14, 2012
  • Like
  • 0