As we know that, Chatter in salesforce makes our applications more collaborative. Chatter can be enabled for both standard and custom objects, making us to know about the changes like new contact created, stage field changes etc., in real-time.
Navigate to the following path to enable Chatter,
Your Name ➤ Setup ➤ Customize ➤ Chatter ➤ Settings
If Chatter is enabled for an organization, it will appear in Users profile page and in Objects Home Page. Embedding Chatter in Visualforce Pages can be made possible by using the <chatter:feed> tag, introduced as a part of Winter '11 Release.
This tag takes the required attribute entityId, which may take values like user Id, record Id from URL etc., as shown below
<apex:page standardController="Opportunity" recordSetVar="Oppties">
<apex:sectionHeader title="List" subtitle="Opportunity"/>
<chatter:feedWithFollowers entityId="{!$User.Id}"/>
<apex:pageMessages />
<apex:pageBlock >
<apex:pageBlockTable value="{!Oppties}" var="oppty">
<apex:column headerValue="Name" value="{!oppty.Name}"/>
<apex:column headerValue="Stage" value="{!oppty.StageName}"/>
<apex:column headerValue="Close Date" value="{!oppty.closedate}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
<apex:sectionHeader title="List" subtitle="Opportunity"/>
<chatter:feedWithFollowers entityId="{!$User.Id}"/>
<apex:pageMessages />
<apex:pageBlock >
<apex:pageBlockTable value="{!Oppties}" var="oppty">
<apex:column headerValue="Name" value="{!oppty.Name}"/>
<apex:column headerValue="Stage" value="{!oppty.StageName}"/>
<apex:column headerValue="Close Date" value="{!oppty.closedate}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
The tag <chatter:feed/> displays Chatter without their followers.
Note: Chatter components are unavailable for Visualforce pages on Force.com sites
yes its valuable.....
ReplyDeleteHi Bharat Mohan ,
ReplyDeleteDo u know how to replicate the same for external authenticated users in visualforce pages !?