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
RajivRajiv 

Follow feature of salesforce for Chatter group

Hi,

 

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.

 

Thanks,

Rajiv

SachiiSachii

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