+ Start a Discussion

Follow feature of salesforce for Chatter group



I have written one trigger where new user starts following chatter group automatically without pressing follow button.

but when I try to insert/ upsert records in the trigger an error comes 

shows  "INVALID_CROSS_REFERENCE_KEY, You cannot follow a collaboration group.: []"


Sample code


EntitySubscription e = new EntitySubscription();   

e.subscriberId = '005E0000000VP6hIAG';             

e.parentId = '0F9M00000008PXSKA2';             

insert e;


but during insertion error comes.             


Does it mean that salesforce follows feature is not supported in chatter group. Can anyone help on this.





Hi..I dont think you can follow a chatter group. you may have to make the user as a member of the group.