1

While using community user to query FeedComment, I get following error:

"Implementation restriction: directly querying FeedComment is only supported for admin users in version 23.0 and higher."

I'm using SalesforceSDK for Ios with APIversion v49.0.

Any help is much appreciated.

1 Answer 1

1

To query FeedComment from the database you'll first need to query one FeedItem and in its SOQL query also request the related FeedItems like so:

  FeedItem record = [
    SELECT
      Id,
      CreatedDate,
      CreatedById,
      CreatedBy.FirstName,
      CreatedBy.LastName,
      ParentId,
      Parent.Name,
      Body,
      BestCommentId,
      CommentCount,
      HasContent,
      HasFeedEntity,
      HasLink,
      HasVerifiedComment,
      IsClosed,
      IsDeleted,
      IsRichText,
      LastEditById,
      LastEditDate,
      LikeCount,
      LinkUrl,
      Status,
      Type,
      Title,
      Visibility,
      (
        SELECT
          Id,
          CommentBody,
          CommentType,
          FeedItemId,
          HasEntityLinks,
          InsertedById,
          IsRichText,
          IsVerified,
          LastEditById,
          LastEditDate,
          ParentId,
          RelatedRecordId,
          Revision,
          Status,
          ThreadChildrenCount,
          ThreadLastUpdatedDate,
          ThreadLevel,
          ThreadParentId
        FROM FeedComments
        WHERE FeedItemId = :feedItemId
      )
    FROM FeedItem
    WHERE Id = :feedItemId
  ];

You must log in to answer this question.

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