この文章は Salesforce 機械翻訳システムを使用して翻訳されました。詳細はこちらをご参照ください。
英語に切り替える

Newer Version Available

This content describes an older version of this product. View Latest

メンションを含むコメントの投稿

この例では、postCommentToFeedElement(communityId, feedElementId, comment, feedElementFileUpload) をコールしてグループをメンションするコメントを投稿します。
1String communityId = null;
2String feedElementId = '0D5D0000000KtW3';
3
4ConnectApi.CommentInput commentInput = new ConnectApi.CommentInput();
5ConnectApi.MentionSegmentInput mentionSegmentInput = new ConnectApi.MentionSegmentInput();
6ConnectApi.MessageBodyInput messageBodyInput = new ConnectApi.MessageBodyInput();
7ConnectApi.TextSegmentInput textSegmentInput = new ConnectApi.TextSegmentInput();
8
9messageBodyInput.messageSegments = new List<ConnectApi.MessageSegmentInput>();
10
11textSegmentInput.text = 'Does anyone in this group have an idea? ';
12messageBodyInput.messageSegments.add(textSegmentInput);
13
14mentionSegmentInput.id = '0F9D00000000oOT';
15messageBodyInput.messageSegments.add(mentionSegmentInput);
16
17commentInput.body = messageBodyInput;
18
19ConnectApi.Comment commentRep = ConnectApi.ChatterFeeds.postCommentToFeedElement(communityId, feedElementId, commentInput, null);