function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SS KarthickSS Karthick 

Getting contentData and ContentFileName for FeedComment Post

Hi folks,
        Can anyone tell me how to get the contentData and contentFileName for FeedComment ?
I can get same for FeedItem using below query.
select Id,RelatedRecordId,Type,Body,CreatedDate,CreatedBy.FirstName,CreatedBy.LastName,Title,LinkUrl,ContentData,ContentFileName From FeedItem


But there is no contentData,ContentFileName field in FeedComment Class.
Please help me how can I  get for FeedComment?

Thanks in advance,
Karthick
David ZhuDavid Zhu
The following is all fields for FeedComment object. You have already get contentData and contentFileName from feedItem. Why would you do it again in FeedComment?

User-added image
SS KarthickSS Karthick
@David Zhu,
      Do you know We can able to attach a file to feed comment .
My question is I want to get the contentData and ContentFileName of the files that are attached to the feedcomment.


 
David ZhuDavid Zhu
If you retrieve "relatedrecordId" field in feedcomment object, it reads "068xxxxxxxxxxx".
068 means standard CONTENTVERSION records. You can get the attachment of the comment in CONTENTVERSION object.

select id,title,contentmodifieddate,description,FirstPublishLocationId,contentdocumentid,versionnumber,VersionData,createdby.firstname from ContentVersion where id = 'relatedrecordid_in_feedcomment'