Loading

Move Chatter Feed from one record to another

Date de publication: Oct 13, 2022
Description
It is not currently possible to simply re-parent Chatter Feed records or move them from one record to another via an update operation. This is because the FeedItem ParentId field that stores the ID of the object type or record to which the FeedItem is related does not support an update call.  To workaround this limitation, you can recreate the posts and associate them with the new parent record. 

The process requires you to export the Chatter posts and its comments with Data Loader, edit the export file to reflect the new record ID, and then insert new Chatter Feed posts to recreate them with Data Loader. Once the chatter feed and comments have been created on the new record, delete the chatter feed items from the source record to remove them.
 
Résolution
Step 1: Perform two separate exports on the FeedItem and FeedComment objects.
  1. Launch Data Loader and click Export
  2. Check next to Show all Salesforce objects
  3. Select  Export Feed Item (FeedItem) or Feed Comment (FeedComment) object. You'll need to repeate this process for each of these objects. 
  4. Select all fields 
  5. Filter the results so that ParentID equals the ID of the old related record. This will allow you to export only the Feed Items and Feed Comments associated with that record.
  6. Click Finish, Yes, and OK.
In the end, you should have two CSV files containing the chatter records associated with the parent record. Review these files to ensure they contain only the records that you want to move. Erase any posts or comments that you do not want to move. 

Note: We recommend that you save a copy of the original files to a safe location for backup purposes. 

Step 2: Next, you'll change the Parent ID column in the CSV files to reflect the new parent record ID.
  1. Change the header of the Parent ID column to Old Parent ID.
  2. Create a new column with the header Parent ID.
  3. Insert the ID associated with the new parent record(s) into the newly created Parent ID column. 
  4. In the FeedItem CSV file, rename the ID column to Old ID. In the FeedComment CSV file, rename the ID column to Old ID and the FeedItemID column to Old FeedItemID. 
  5. Save these two separate files as CSV files. 
Step 3. Use Data Loader to perform an Insert on the FeedItem object. 

Step 4. Get the new Id of the FeedItem and match it to the old one. The success file from Data Loader should have this information.

Step 5. On the new FeedComment CSV, replace the Old FEEDITEMID create a new column called FeedItemID and insert the new FeedItem record IDs that you found Step 4. 

Step 6. Use Data Loader to perform an Insert on the FeedComment object.

Step 7. Delete the Chatter Feed post and comment from the Record A by using the Old FeedItem ID and the Old FeedComment ID.


Note: If the logged-in user has the “Insert System Field Values for Chatter Feeds” user permission, the create field property is available on CreatedBy and CreatedDate system fields for this object. This allows the logged-in user to set these fields to the original post author and creation date upon migration instead of accepting the system field value when migrated, which would be the logged-in user and the date the migration was performed, respectively. The fields can't be updated after migration.


See Also:
FeedItem
FeedComment
 
Numéro d’article de la base de connaissances

000387796

 
Chargement
Salesforce Help | Article