Reply
Regular Contributor
D_M_C
Posts: 17
0
Accepted Solution

Cannot insert FeedItem to a Chatter Group

I am using Java with the SOAP api to transfer Chatter records.  I cannot post messages to existing Chatter groups.

 

The code below is simple Java code that tries to create a new FeedItem, add it to a group and insert the record.  I have confirmed that the userID is correct, the groupId is correct AND the user belongs to the group.  The user account I am using to do the transfer has the "Manage Chatter Messages" enabled.  I am using API v 25.

 

Why is my attempt to post to a group failing?

 

The error message I get is: The Insert failed because: insufficient access rights on cross-reference id

 

		String userID = "005E0000001JywAIAS";
		String groupId = "0F9E0000000Tp2mKAC";
		FeedItem newFeed = new FeedItem();
		Calendar greg = Calendar.getInstance();
		greg.add(Calendar.HOUR, -48);
		
		//newFeed.setId(feed.getId());
		newFeed.setBody("Faked ITEM GROUP test");
		newFeed.setParentId(groupId);
		newFeed.setCreatedDate(greg);
		newFeed.setCreatedById(userID);
		
		List<FeedItem> list = new ArrayList<FeedItem>();
		list.add(newFeed);
		loginCentral();
		SObject[] objs = new SObject[1];
		objs[0]=newFeed;
		uploadRecords(objs);

		logout();

 

Super Contributor
Jia Hu
Posts: 839
0

Re: Cannot insert FeedItem to a Chatter Group

Your User must be the member of this Group first.