如何在 C# 中使用 Chatter SalesForce WSDL 服务检索 FeedComment

发布于 2024-11-29 15:36:35 字数 92 浏览 0 评论 0原文

我必须检索销售人员聊天的新闻提要我能够获得主要状态,但无法检索评论。是否有任何示例可以在 c# 中使用 SalesForce chatter WSDL API 获取评论?

I have to retrieve News feed of salesforce chatter I am able to get main status but not able to retrieve comments. Is there any sample to get comments using SalesForce chatter WSDL API in c#?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夜无邪 2024-12-06 15:36:35

您可以使用子关系查询从 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);
}

You can use child relationship queries to traverse from the NewsFeed to the child FeedComments. Here's an example of a SOQL query that returns both the main status and comments for a given user:

SELECT Id, Body, (Select Id, CommentBody FROM FeedComments) FROM NewsFeed WHERE ParentId = '00560000000wX0aAAE'

Not sure about C# specifically, but it will likely return the FeedComments as a nested array. Here's an example of iterating over the results in 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);
}
何必那么矫情 2024-12-06 15:36:35

这将为您带来 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

This will get you NewsFeed + Comments + Likes:

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文