function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
cozzacozza 

I want to be able to add followers to an object

Hi,

 

I want to be able to add followers to an opportunity. Does anyone know how to do this.

 

this use case is that I have an opportunity and that I want to get some other people involved, do get them involved I want to add them on as followers. I want the adding of the users to be driven from the user level

rwoollenrwoollen

EntitySubscription is the SObject you want to use here.  Basically the SubscriberId field is the user and the ParentId is the record being followed.

 

Essentially you'd want to query first to filter out anyone who was already following the record and then insert new EntitySubscription records for the users who weren't yet following the opportunity.

 

Your exact recipe is not in this article, but you mightfind it helpful in general: http://wiki.developerforce.com/index.php/Chatter_Code_Recipes

Tall 642Tall 642

I would like to do this as well. I know the functionality exists within the Groups object. You can click and "Add" people to a group. I want to reuse this functionality on any object. Is that possible?

Christina ApostolouChristina Apostolou

Thank you!

That was very useful,

Christina