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