1

I am trying to create a feeditem and trying to find a documentcontent file and attaching it to this feeditem through a flow.

I think I can find the version of the contentdocument by looking at the contentdocumentlink and using the linkedentityid to relate it back to the feeditem.

I need to somehow attach this file to the feeditem like what was done below.

Is it possible? As you can see it has been done on our org but Im not sure how it was done previously.

Thanks in advance!

enter image description here

2 Answers 2

1

The reference you want to use is the schema for Chatter Objects

  • Once the FeedItem has been created and you've located the ContentDocument (which points at the latest ContentVersion) ..
    • Create a FeedAttachment as a child to FeedItem
      • FeedEntityId is the lookup to the FeedItem
      • RecordId is either a ContentDocumentID (inline images) or ContentVersionId (attachment)
      • Title is some name
      • Type is as per the doc
2
  • Thanks for that, this is a good solution. I used a flow got the contentversion id of my PDF. However I am getting this error. Attachment Record ID: id value of incorrect type: Also tried the contentdocument id and i got the same error. Not sure what to do so that it will accept the id i want to use??? Commented Oct 17, 2022 at 2:53
  • OH nvm I think i may have worked it out. I didnt add the type Commented Oct 17, 2022 at 3:08
0

You need to understand the relationship between Content Documents, Content Versions, and Content Document Links. Basically:

  • Content Document represents the file in the abstract. But “real” versions of this document are distinct and have different version numbers, so there’s also a…

  • Content Version represents a specific version of the Content Document. A Content Document can have multiple Content Versions

  • Content Document Link is used to connect a Content Docum ent to a record.

Also see information on this page.

My guess is that you need to be manipulating the appropriate ContentVersion

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .