I recently created a chatter group and I have been trying to get certain chatter posts sent to the chatter group via process builder. Salesforce doesn't allow rich text for feed items via automation so I want to default those chatter posts to mention the chatter group. Is there anyway that this is possible?
Default text in chatter post
Merge ActivityTimeline and Chatter Tabs on Lightning Page
On the Account Lightning Record Page, I have added the Activity Timeline to the right sidebar, which includes the buttons for Log a Call, New Task and New Event. I've also added a separate Tab to that section for Chatter, which enables commenting on Activities in the feed and posting to Chatter.
I've been told by a user that at a previous job, these two pieces of functionality were merged into a single tab with all buttons available. I'm able to put Chatter on the same tab above or below the Activity Timeline, but this results in a duplicate feed of Tasks/Events. Researching hasn't led me to anything obvious that would combine these two items, so I'm guessing that this was a custom page developed at the user's previous employer.
Any ideas on how this can be accomplished?
POST as another user using Salesfore API. (Sender Id unavailable in request body)
I am trying to use chatter REST API to GET and POST data into custom C# application from a Salesforce. I am able to get data successfully. But, when I try to POST data into Salesforce as a particular user(Users who do not have ConnectedAPI) it won't POST into the Salesforce chatter.
Please let me know how I could POST into Salesforce chatter as a different user(Users who do not have ConnectedAPI) from ConnectedAPI user. I use the ConnectedAPI user account for the POST.
In below JSON request Is there a way to add sender ID in request body? So, the chat in salesforce shows the right person.
REST URL : https://salesforce.com/services/data/v42.0/chatter/feed-elements
Request Body:
{
"body" : {
"messageSegments" : [
{
"type" : "Text",
"text" : "Test message"
}]
},
"feedElementType" : "FeedItem",
"subjectId" : "Receiver ID here"
}
Multiple Files on chatter Feed is not showing when created from apex
I see Chatter post can allow multiple files to be posted at a time in Lightning. But from the below code in Apex, I'm only able to get one file on the chatter post.
List<ConnectApi.BatchInput> batchInputs = new List<ConnectApi.BatchInput>();
ConnectApi.FeedItemInput feedItemInput = new ConnectApi.FeedItemInput();
ConnectApi.MessageBodyInput messageBodyInput = new ConnectApi.MessageBodyInput();
ConnectApi.TextSegmentInput textSegmentInput = new ConnectApi.TextSegmentInput();
messageBodyInput.messageSegments = new List<ConnectApi.MessageSegmentInput>();
textSegmentInput.text = 'Testing';
feedItemInput.body = messageBodyInput;
feedItemInput.feedElementType =
ConnectApi.FeedElementType.FeedItem;
feedItemInput.subjectId = subjectId;
feedItemInput.capabilities = new
ConnectAPI.FeedElementCapabilitiesInput();
feedItemInput.capabilities.files = new ConnectAPI.FilesCapabilityInput();
feedItemInput.capabilities.files.items = new List<ConnectAPI.FileIdInput>();
List<Id> fileIds = new List<Id>();
fileIds.add('06922000000dMR8AAM');
fileIds.add('06922000000dMR7AAM');
for(Id conDoc : fileIds){
ConnectAPI.FileIdInput attachFile = new
ConnectAPI.FileIDInput();
attachFile.id = conDoc;
feedItemInput.capabilities.files.items.add(attachFile);
}
ConnectApi.BatchInput batchInput = new
ConnectApi.BatchInput(feedItemInput);
ConnectApi.ChatterFeeds.postFeedElementBatch(Network.getNetworkId(), batchinputs);
Can any one please help me, how to show multiple files on a chatter post. I see the code runs fine in the debugs, but only the visibility on the Chatter post on the page they aren't showing multiple files. Only a single file is posted.
File link appears when Chatter Feed is hidden and Page is refreshed
I have a requirement to hide the File Link in chatter feed. I have a VF Page and I am able to do this using the below code.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$j = $.noConflict();
$j(document).ready(function(){
$j('#publisherAttachContentPost').hide();
});
</script>
<div id="chatter-container">
<chatter:feedWithFollowers entityId="{!Object1__c.id}" showHeader ="true" oncomplete="refreshStatus()" reRender="statusPanel" />
</div>
But this works only when show Feed is clicked and the record is opened or refreshed. Below is the screenshot.
If the Show Feed is not clicked earlier
and if you open or refresh the record and click on Show Feed, then the File link still appears. Below is the screenshot.
Can some please tell me what am I missing.
View a child record's chatter feed from Parent record
The Problem: Chatter feeds are powerful, but require the User to open the record to view it. When trying to centralise everything on a single Parent record, this does not make for a great UI/UX.
The Question: Does anyone know of an easy/light-weight way to display a child record's chatter feed on the parent record's lightning page?
Off the top of my head, I'm thinking about a VF page or lightning component solution which let's the user select a related record from a dropdown list and then displays the chatter feed for it below the dropdown list.
Can anyone offer some sample code or point me to a 3rd party app for accomplishing this?
Is there a way to change the "primitive" icon in a Chatter/Feed post when posting via Apex?
How do I avoid error ConnectApi.ConnectApiException: Cannot provide both 'Poll' and 'QuestionAndAnswers' capability values at the same time
I am trying to set a question title for a poll chatter post created by apex using the following code
CollaborationGroup g = [SELECT Id FROM CollaborationGroup WHERE Name='Edge Communications Customer Support'];
ConnectApi.PollCapabilityInput poll = new ConnectApi.PollCapabilityInput();
poll.choices = 'Yes,No'.split(',');
ConnectApi.FeedElementCapabilitiesInput feedElementCapabilitiesInput = new ConnectApi.FeedElementCapabilitiesInput();
ConnectApi.QuestionAndAnswersCapabilityInput questionAndAnswersCapabilityInput = new ConnectApi.QuestionAndAnswersCapabilityInput();
ConnectApi.MessageBodyInput messageBodyInput = new ConnectApi.MessageBodyInput();
feedElementCapabilitiesInput.poll = poll;
feedElementCapabilitiesInput.questionAndAnswers = questionAndAnswersCapabilityInput;
questionAndAnswersCapabilityInput.questionTitle = 'Are we doing a good job handling Edge Communications customer support inquiries?';
ConnectApi.FeedItemInput feedItemInput = new ConnectApi.FeedItemInput();
feedItemInput.body = messageBodyInput;
feedItemInput.capabilities = feedElementCapabilitiesInput;
feedItemInput.feedElementType = ConnectApi.FeedElementType.FeedItem;
feedItemInput.subjectId = g.Id;
ConnectApi.ChatterFeeds.postFeedElement(null, feedItemInput );
When I execute this code, I receive the following error
! ERROR: ConnectApi.ConnectApiException: Cannot provide both 'Poll' and
! 'QuestionAndAnswers' capability values at the same time.
! ERROR: Class.ConnectApi.ChatterFeeds.postFeedElement: line 1458, column 1
! AnonymousBlock: line 27, column 1
ERROR running force:apex:execute: Class.ConnectApi.ChatterFeeds.postFeedElement: line 1458, column 1
AnonymousBlock: line 27, column 1
Looks like it doesn't want me to provide both choices and question title at the same time. How do I overcome this?
Question to case
Unable to identify which type of post User Profile Stats standard component counts
I have created the custom user profile stats that can be seen below as Influence Custom. The purpose of creating the replica is to make text under the count clickable and when users click on the link it can show the list of the respective item records.
Everything is done except this one issue that you can see in the screen snap that standard one shows the different number of the post then the custom one.
I am trying to figure out what type of posts standard component retrieves so that I can filter the same post in the custom component.
I am using ConnectAPI.ChatterUser Class to show followers and following.
and for Post, Comment and Like I am doing SOQL on FeedItem and FeedComment.
I am using the following method to show the list of the post.
@AuraEnabled public static List<FeedItem> getPostList(String userId, String type){ List<FeedItem> fItems = new List<FeedItem>(); if(type == 'comment') { system.debug('Comment'); Set<Id> feedItemComment = new Set<Id>(); List<FeedComment> fComment = [SELECT Id, CreatedById, FeedItemId, InsertedById, CommentBody FROM FeedComment where InsertedById =:userId]; for(FeedComment fcom : fComment) { feedItemComment.add(fcom.FeedItemId); } fItems = [SELECT ID, CreatedDate, CreatedById, CreatedBy.FirstName, CreatedBy.LastName, ParentId, Parent.Name, Body, InsertedById, Type, Title, LinkUrl, LikeCount FROM FeedItem Where Id in: feedItemComment]; } else if(type == 'like') { system.debug('Like'); fItems = [SELECT ID, CreatedDate, CreatedById, CreatedBy.FirstName, CreatedBy.LastName, ParentId, Parent.Name, Body, InsertedById, Type, Title, LinkUrl, LikeCount FROM FeedItem Where CreatedById =: userId and LikeCount > 0 ]; } else if(type == 'post') { system.debug('Post'); fItems = [SELECT ID, CreatedDate, CreatedById, CreatedBy.FirstName, CreatedBy.LastName, ParentId, Parent.Name, Body, InsertedById, Type, Title, LinkUrl, LikeCount FROM FeedItem Where CreatedById =: userId]; } return fItems;}
How to get ENABLED Feed Tracking custom object fields
How can I query (SOQL/APEX/API) the feed tracking custom object fields that has CHECKED ENABLE FEED TRACKING? I'm looking to get the ONLY fields that has FEED TRACKING.
As shown the screen shot below, I like to query to see if the Age
or Country
or City
has enabled feed tracking, is that possible to do?
Change FeedItemPost CreatedById using ConnectApi
I want to post chatter items via Apex
with a link attached and an @ mention. I've been able to figure out how to attach the link and @ mention through research.
The next step to finishing this is to change the CreatedById
of the post - Instead of it saying MyName to FriendName
, I want it to say AnotherUser to FriendName
.
Doing this using the FeedItem
object is relatively easy since you can change the CreatedById
value but I'm having trouble figuring out how I can do that with the ConnectApi
.
Here is my code so far :
ConnectApi.FeedType feedType = ConnectApi.FeedType.UserProfile;ConnectApi.FeedItemInput feedItemInput = new ConnectApi.FeedItemInput();feedItemInput.subjectId = 'Friends Id'ConnectApi.MentionSegmentInput mentionSegmentInput = new ConnectApi.MentionSegmentInput();ConnectApi.MessageBodyInput messageBodyInput = new ConnectApi.MessageBodyInput();ConnectApi.TextSegmentInput textSegmentInput = new ConnectApi.TextSegmentInput();messageBodyInput.messageSegments = new List<ConnectApi.MessageSegmentInput>();textSegmentInput.text = 'Congrats ';messageBodyInput.messageSegments.add(textSegmentInput);mentionSegmentInput.id = 'Friends Id';messageBodyInput.messageSegments.add(mentionSegmentInput);ConnectApi.LinkCapabilityInput linkInput = new ConnectApi.LinkCapabilityInput();linkInput.url = 'www.helloworld.com';linkInput.urlName = 'hello world';ConnectApi.FeedElementCapabilitiesInput feedElementCapabilitiesInput = new ConnectApi.FeedElementCapabilitiesInput();feedElementCapabilitiesInput.link = linkInput;feedItemInput.capabilities = feedElementCapabilitiesInput;feedItemInput.body = messageBodyInput;ConnectApi.FeedElement feedElement = ConnectApi.ChatterFeeds.postFeedElement(Network.getNetworkId(), feedItemInput);
Open to other approaches too
How to disable the creation of feed items when a task is created via the REST API
We have an integration between our phone system (3CX) and Salesforce. It logs calls into Salesforce using the REST API: /services/data/v37.0/sobjects/task RequestType="Post"
Those tasks have the user as ownerid and each logged call appears in the chatter feed.
These feed items also appear in the users Daily Digest and make it therefore more annoying than usefull...
How can I disable the creation of those feed items?It tried this :https://success.salesforce.com/answers?id=9063A000000ld0DQAQ (unckeck Create Feed Item in Global Actions)It does not help...
Can "Chatter External" licence user post feed on community lighting?
I have a user who has the "Chatter External" license profile. Can he post feed item on chatter on nay object?
Because chatter External user does not have access to any object.
Email Triggered on Chatter post even when CollaborationGroupMember NotificationFrequency is set to N
I have a chatter group on my salesforce org. I created a trigger on user object which creates a collaborationgroupmember record and adds it to that particular chatter group.
Now when the collaborationGroupMember is created, I set the NotificationFrequency to N. As per the given documentation for value N, email should not be triggered to any of the other users to the group, if that particular user posts something on the chatter group.
However, still then when the newly created user posts something on the group, the email is fired.
Process builder's Post to Chatter error
In Process builder, I have a Post to Chatter action. When this action gets triggered, I am getting error message and exception is thrown. I have attached the error line from debug logs: FLOW_ACTIONCALL_DETAIL|9086c181606dd98184557174ae5116d63ba0a-8282|myRule_1_A1|Post to Chatter|chatterPost|false|Guest users are not permitted to perform this operation.
We have gues user with the profile license 'Guest User License'.
Here is the screenshot of the Post to Chatter in Process builder:
Integrate custom lightning web application with chatter
I am trying to integrate my custom application I built with the help of the LWC with chatter so that user can post notes or send emails from application. I tried searching on google on how to do this, I found the way for aura components, but not for web components. Is there any way to add chatter functionality to lighting web application.
Thank you.
Embedding videos in Chatter feed for Lightning Salesforce Community
I have been trying to embed video links in Chatter feed on Lightning Salesforce Community for which I enabled "Allow users to compose rich text posts" and "Allow Rich Link Previews" in the chatter settings, but the video preview is not showing up.
I see this working in Salesforce classic
Not sure if I am missing enabling permission for Lightning.
Enable Community Case Feed not visible from Support Settings
I am trying to enable the Community Case Feed in a sandbox of mine and I cannot see the setting from the Support settings page. Communities are enabled, and Feed Tracking is enabled on the Case object. Has anyone else faced this issue?
Thanks for your help!-Mitch
Disable Tasks in Chatter Feeds
With Salesforce.com Spring ’13 Release we got the feature: "Chatter feed notification on task creation"and in order to turn it off:
Click Your Name > Setup > Customize > Chatter > Settings and de-select "Tasks in Feed"
Now "Tasks in Feed" checkbox is not there anymore , how can i disable chatter feed notification on task creation?
I have tried:Setup > Customize > Chatter > Feed Tracking, scroll down to Tasks, and disable feed tracking for Tasks but it doesn´t turn off task feeds.
Thanks in advantage for any advice.