Move Chatter Feed from One Record to Another
|Knowledge Article Number||000213215|
|Description||In order to move a Chatter Feed and its related comments from one record to another you will need to export the Chatter Feed records and comments from the source record, update the export file, and then associate them to your new target record by inserting or re-creating the feeds. Once the chatter feed and comments have been created on the target record delete the chatter feed items from the source record to remove them.
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's ParentId field that stores the ID of the object type or record to which the FeedItem is related does not support an update call. Instead, it is necessary to move chatter feeds to new records by re-creating or inserting them in relation to the new desired record.
|Resolution||Step 1: Export FeedItem and FeedComment object. Make sure you select the "Show all Salesforce objects" box.
Step 2: On the next screen, add a filter to your query. Make sure you click on the "Select all fields". Make sure to add the filter ParentId equals <Record A id>. The ParentId is the id of the record you wanted to export from.
Step 3. Click Finish. You should have 2 CSV files based on your 2 export operation - the FeedItem object and the FeedComment object.
Step 4: Modify the Parent Id column of your CSV file and place the id of the record you would like to move the chatter feed to. In your case, replace it with <Record B id> . Rename the id column as Old id. Do this for the FeedItem object. For the FeedComment object file, rename the ID to Old ID and FEEDITEMID to Old FEEDITEMID.
Step 5. Insert the FeedItem Object to your organization.
Step 6. 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 7. On the FeedComment CSV, Make sure to replace the Old FEEDITEMID with the new FEEDITEMID taken from the FeedItem CSV file.
Step 8. Insert the FeedComment using Data Loader.
Step 9. 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.
Insert, Update, or Delete Data Using Data Loader