+ Start a Discussion
Team WorksTeam Works 

HomePage Component

Hello All,

I need to create a Home Page component with a Tab 'Interested In'. In this tab i need to display the Accounts i am following(irrespective of I own it or not.)  I am the logged in User..

Please guide/suggest

Many Thanks
Best Answer chosen by Team Works
Team WorksTeam Works
Hi Sonam,

I acheived it : Here is sample
EntitySubscription[] followingES = [select id, parentid, subscriberid, parent.name

                                    from EntitySubscription

                                    where subscriberid =:UserInfo.getUserId()];//Set to the User's Id

system.debug(followingES);
Set<Id> UserIFollowId = new Set<Id>();
List<User> UserIFollow = new List<User>();
for(EntitySubscription es : followingES){
    UserIFollowId.add(es.parentId);}

UserIFollow= [Select FirstName, LastName from User where Id in : UserIFollowId];

All Answers

Sonam_SFDCSonam_SFDC
Hi,

You can try creating a visualforce page and embed it using iframe as the home page component..

go through the code on the following blog : http://visualforcemadeeasy.blogspot.in/2009/03/embed-visualforce-page-on-home-page.html
worth a try!

Team WorksTeam Works
Hi Sonam,

Thanks for your reply. I have already created the homepage component and VFP. Need guide on how can i get the List of People/Objects, ithe logged in User following?

Kind R

Team WorksTeam Works
Hi Sonam,

I acheived it : Here is sample
EntitySubscription[] followingES = [select id, parentid, subscriberid, parent.name

                                    from EntitySubscription

                                    where subscriberid =:UserInfo.getUserId()];//Set to the User's Id

system.debug(followingES);
Set<Id> UserIFollowId = new Set<Id>();
List<User> UserIFollow = new List<User>();
for(EntitySubscription es : followingES){
    UserIFollowId.add(es.parentId);}

UserIFollow= [Select FirstName, LastName from User where Id in : UserIFollowId];
This was selected as the best answer