我必须检索 salesforce chatter 的新闻提要我能够获得主要状态但无法检索评论。是否有任何示例可以在 c# 中使用 SalesForce chatter WSDL API 获取评论?
问问题
1750 次
2 回答
3
您可以使用子关系查询从 NewsFeed 遍历到子 FeedComments。以下是返回给定用户的主要状态和评论的 SOQL 查询示例:
SELECT Id, Body, (Select Id, CommentBody FROM FeedComments) FROM NewsFeed WHERE ParentId = '00560000000wX0aAAE'
不确定 C#,但它可能会将 FeedComments 作为嵌套数组返回。这是在 Apex 中迭代结果的示例:
NewsFeed nf = [SELECT Id, Body, (Select Id, CommentBody FROM FeedComments) FROM NewsFeed WHERE ParentId = '00560000000wX0aAAE'];
System.debug(nf.Id);
System.debug(nf.Body);
for (FeedComment fc : nf.FeedComments) {
System.debug(fc.Id);
System.debug(fc.CommentBody);
}
于 2011-08-14T03:44:43.607 回答
2
这将为您提供 NewsFeed + 评论 + 喜欢:
SELECT Id, Type,
CreatedById, CreatedBy.FirstName, CreatedBy.LastName,
ParentId, Parent.Name,
Body, Title, LinkUrl, ContentData, ContentFileName,
(SELECT Id, FieldName, OldValue, NewValue
FROM FeedTrackedChanges ORDER BY Id DESC),
(SELECT Id, CommentBody, CreatedDate,
CreatedBy.FirstName, CreatedBy.LastName
FROM FeedComments ORDER BY CreatedDate LIMIT 10),
(SELECT CreatedBy.FirstName, CreatedBy.LastName
FROM FeedLikes)
FROM NewsFeed
ORDER BY CreatedDate DESC, Id DESC
LIMIT 100
于 2011-10-31T11:43:34.820 回答