I'm trying to update a sobject (CollaborationGroupFeed) via apex, but I am unable to update a particular reference field (in this case: CreatedBy).
Here is my code:
CollaborationGroupFeed cgf = [SELECT Id, CreatedById FROM CollaborationGroupFeed WHERE Id =: feedElement.Id LIMIT 1]; User u = [SELECT Id, Name FROM User WHERE FirstName = 'Steve' AND LastName = 'Jobs']; cgf.CreatedById = u.Id; update cgf;
Error message: Field is not writeable: CollaborationGroupFeed.CreatedById
CreatedById
, notCreatedBy
. This field is not writeable.