I am trying to insert contentdata (e.g. pdf present on my local computer) as feedcomment or post in a group. but i am not able to do it. con anyone suggest how to do it?
I am new to salesforce.
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
The answer is all in the documentation:
delete(), describeLayout()describeSObjects(), query(), retrieve(), search(), undelete(), update()
As you can see, no create(), so you cannot insert a new one with data loader
A solution I used is to Insert all files that I'll share in a library. You can create a new one or use a previous one. Use the ContentVersion object to insert the files, observing the fields NetworkId(if you need it to be seeing in a Community) and firstPublishedLocation(to make it visible to others users, publish it in a public library) I also created previously the posts I have to attach the files, FeedItems After this insertion you can use the ContentDocumentID generated (map with ContentVersionId) and insert a new FeedAttachment to create the link between the post and the file.
I strongly recommend the creation of FeedComments inserting the file at the same time, because you can only attach anything at insertion, otherwise you will not be able to update the post to add any attachment.
You can also insert the files as attachments to feedItems at the creation of the FeedComment record.