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
Shruti VishShruti Vish 

How to query on ideacomment object

Hi all,

I want to retrive comment value from ideacomment object
Best Answer chosen by Shruti Vish
LBKLBK
Hi Shradha,

IdeaComment can be queried by passing a single IdeaId or a list of Ids.

Here is the sample query to fetch the Comment Content.
 
SELECT CommentBody,CommunityId,CreatorName,Id,IdeaId,UpVotes FROM IdeaComment WHERE IdeaId = '08728000000IOPeAAP'
You can replace the IdeaId value with a sub query on Idea object itself.

Hope this helps.

All Answers

LBKLBK
Hi Shradha,

IdeaComment can be queried by passing a single IdeaId or a list of Ids.

Here is the sample query to fetch the Comment Content.
 
SELECT CommentBody,CommunityId,CreatorName,Id,IdeaId,UpVotes FROM IdeaComment WHERE IdeaId = '08728000000IOPeAAP'
You can replace the IdeaId value with a sub query on Idea object itself.

Hope this helps.
This was selected as the best answer
Prithviraj_ChavanPrithviraj_Chavan
SELECT CommentBody,CommunityId,CreatorName,Id,IdeaId,UpVotes FROM IdeaComment

in aboves query you must filter your records by CommunityId , Id, IdeaId , Id
like

SELECT CommentBody,CommunityId,CreatorName,Id,IdeaId,UpVotes FROM IdeaComment WHERE CommunityId = '';//Id = '' // IdeaId = ''