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
mms.testsmms.tests 

Posting to a Collaboration Group

can I post to a Collobration Group (chatter group) using the create() method?

 

using FeedItem's create method, I can post a message. If I want to post to a group, I guess I have to use groupId as parentID? I can't seem to find out the CollaborationGroupId from the CollaborationGroup object.

 

Thanks in advance for any help.

mms.testsmms.tests

Solved: even though the API doc does not list ID as attribute, the ID actually can be returned.

alouie_sfdcalouie_sfdc
System fields like the ID field are described in the documentation here:

http://www.salesforce.com/us/developer/docs/api/Content/system_fields.htm
jody_blyjody_bly

Every object has an Id, which may be why that field isn't listed in the docs, but the omission does seem a bit odd to me. I'll check with some colleagues on the doc team to see what the history is.

 

l know you've solved your problem, so I'm just listing these resources for posterity:

 

The Object Reference says:

This section provides a list of standard objects and their standard fields. Some fields may not be listed for some objects.

To verify the complete list of fields for an object, you can use a describe call from the API, or inspect with an appropriate tool, for example, inspecting the WSDL or using a schema viewer. One of the tools you can use to list the fields is Workbench

 

Also, you can use Chatter REST API and Chatter in Apex to post to a group:

 

POST /chatter/feeds/record/{groupId}/feed-items

http://www.salesforce.com/us/developer/docs/chatterapi/Content/connect_resources_how_to.htm#cc_post_to_groups

 

ConnectApi.ChatterFeeds.postFeedItem(String communityId, ConnectApi.FeedType feedType, String subjectId, String text)

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_ConnectAPI_ChatterFeeds_postFeedItem.htm

 

Hope that helps

jody_blyjody_bly
Thanks, Arthur, I didn't know about that page!

#discussionboardsrace
mms.testsmms.tests

thanks very much, alouie_sfdc and jody_bly!