Activity › Forums › Salesforce® Discussions › Can I change which records chatter files are shared to through Apex?

  • Surbhi

    Member
    May 26, 2016 at 6:00 AM

    Hi Ravi,

    You have to work on the "FeedItem" Object. Here are the steps:

    1. Get the FeedItem, that has Type = 'ContentPost' and ParentId = AccountId.
    2. Create a new FeedItem object and copy the Body, RelatedRecordId, Title & Type fields from FeedItem record from Step 1.
    3. Set the new FeedItem from Step 2. ParentId as the AccountId you want to move attachment to.
    4. Insert FeedItem, (and delete prev. feed Item if you want to).

    Thanks

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos

Pros & Cons of Lightning Component vs. 3rd party frameworks in Salesforce UI development

Video in

Nikita drops by to share his invaluable experience of using popular 3rd party frameworks in Salesforce. http://media.blubrry.com/salesforceway/audio.xmcdn.com/group42/M05/25/57/wKgJ81rXk6XjaZIAAU_I_KtprFM998.m4a