0

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.

  • I tried to insert data using below csv file. – user1037452 Aug 11 '15 at 5:22
  • PARENTID OWNERID BODY NAME ERROR 0D5e000000JaiZmCAJ 005a000000BoNJi C:\Users\abc\Documents\new_report.pdf new_report entity type cannot be inserted: Content Document – user1037452 Aug 11 '15 at 5:22
  • Hi All,any comments? – user1037452 Aug 11 '15 at 9:37
1

The answer is all in the documentation:

Supported Calls

delete(), describeLayout()describeSObjects(), query(), retrieve(), search(), undelete(), update()

https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contentdocument.htm

As you can see, no create(), so you cannot insert a new one with data loader

| improve this answer | |
0

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.