4

I have a private chatter group in community. I want to post something in this group by System Admin.

When system admin create a FeedItem and putting ParentId = groupId programatically then getting following Exception :

INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id:

I have also changes the Group Access as public or Unlisted, but error remain the same. Please help me for the same. Follwing is code :

FeedItem feed = new FeedItem();

feed.Body = 'Hello from Admin';

feed.ParentId = '0F9M00000009V7v'; // Community's Chatter Group ID 

feed.visibility = 'AllUsers';

insert feed;
4
  • 1
    Does the system admin user have explicit access to the Group? Commented Jan 12, 2016 at 8:09
  • Yes. system admin user have explicit access to the Group @Sebastian Kessel
    – Om Prakash
    Commented Jan 12, 2016 at 9:10
  • Class is sharing included.
    – Om Prakash
    Commented Jan 12, 2016 at 12:47
  • 1
    Try setting feed.NetworkId to the community's ID also. If the NetworkId isn't set, it defaults to the internal network, which the Chatter group is not a part of. You also don't need to set feed.visibility, because it only applies to posts on records (not groups).
    – alouie
    Commented Jan 12, 2016 at 22:09

1 Answer 1

3

I have fixed this issue. I have passed Network scope id.

feed.ParentId = ''; // Community's Chatter Group ID

feed.NetworkScope= ''; // ID of community (network)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .