Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Chatter Development
- :
- How to unfollow the message from Chatter
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
How to unfollow the message from Chatter
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-01-2012 09:52 AM
when ever am inserting record am displaying the EntitySubscription to the record owner chatter. How to delete this added EntitySubscription from the user chatter.
If record CreatedDate > 90days i want to delete those EntitySubscription from the chatter.
Give me ideas on this. how to delete EntitySubscription from the chatter.
The following is the code am using to add "EntitySubscription" to the chatter.
trigger EntySubscription on Employee__c(after insert)
{
public List<AccountTeamMember> teammember;
if ( Trigger.isInsert)
{
for (Employee__cest: Trigger.new)
{
if ( est.Id != null)
{
Account ac = [select Id,Name from Account where Id =: est.Account__c];
teammember = [ select Id, UserID, AccountId from AccountTeamMember where AccountId =: ac.Id];
System.debug('****************Team members**************'+teammember);
if( teammember != null && teammember.size() > 0)
{
for(Integer i=0; i<teammember.size();i++)
{
System.debug('*********User ID*****'+teammember+'*******'+teammember[i].UserID
User u = [SELECT Id,Name FROM User where Id =:teammember[i].UserId];
System.debug('************User Name***************'+u.Name);
EntitySubscription follow = new EntitySubscription (
parentId = est.Id,
subscriberid = teammember[i].UserId ) ; //your User Id
insert follow;
}
}
}
}
}
}
Re: How to unfollow the message from Chatter
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-02-2012 11:24 PM
Hello Krish,
Checkout my comment in your previous post,and let me know in case of any iissues.
Regards,
Bharathi
Salesforce For All
Mrk this post as solved, if it helps you

