I am trying to create a chatter group via apex and assign a record to it as the group record. Now I have this code to create the Chatter group:
CollaborationGroup myGroup = new CollaborationGroup();
myGroup.Name='TEST (DAV) - SALESFORCE 2';
myGroup.CollaborationType='Private'; //can be 'Public' or 'Private'
insert myGroup;
This works great, it creates the group, but now I want to add a record to the group. I believe it has something to do with CollaborationGroupRecord
but I cannot seem to find code on this. I believe it should be a process where I create the chatter group as highlighted before then create a collaboration group record which is then associated with the chatter group.
Any suggestions?