0

I am using the Connect API to create a custom feed. This is working fine when I am using user in @mention but when I am using the group in @ mention it is not doing the feed post an exception is coming(the Mentioned group doesn't available). Sample Code: ConnectApi.FeedItemInput feedItemInput = new ConnectApi.FeedItemInput(); ConnectApi.MentionSegmentInput mentionSegmentInput = new ConnectApi.MentionSegmentInput(); ConnectApi.MessageBodyInput messageBodyInput = new ConnectApi.MessageBodyInput(); ConnectApi.TextSegmentInput textSegmentInput = new ConnectApi.TextSegmentInput(); messageBodyInput.messageSegments = new List();

mentionSegmentInput.id = 'mention group id'; messageBodyInput.messageSegments.add(mentionSegmentInput); textSegmentInput.text = 'Test11'; messageBodyInput.messageSegments.add(textSegmentInput); feedItemInput.body = messageBodyInput; feedItemInput.feedElementType = ConnectApi.FeedElementType.FeedItem; feedItemInput.subjectId = 'user id who create the chatter'; ConnectApi.FeedElement feedElement = ConnectApi.ChatterFeeds.postFeedElement(Network.getNetworkId(), feedItemInput);

  • 1
    Please edit your question to include a reproducible code example and the specific location of the error. Thanks! – David Reed Apr 19 '19 at 7:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.