[SalesForce] creating Chatter FeedItem with sites user

is it possible to create a chatter FeedItem with a sites user with public access, is there any workaround to get this done?

I tried to insert it with "insert" and also with the ConnectApi but I got the same error message:
Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Entity is read-only: FeedItem: [].

it works with the standard salesforce user but not by creating the item through a salesforce sites user with public access.

    FeedItem                                        FInew                           = new FeedItem();
                                                    FInew.parentId                  = qu.Id;
                                                    FInew.Body                      = FeedBody;
    insert                                          FInew;

or:

ConnectApi.ChatterFeeds.postFeedItem( null, ConnectApi.FeedType.Record, string.ValueOf(ALI.Id), FeedBody);

Best Answer

In addition to the suggestions by BritishBoyinDC, an easier way would be by inserting the entries from the public site into a custom object. Then have a scheduled class pick up the messages from the custom object and post for chatter feed. This, however, would not be real-time. The scheduled job at best can run once every hour.

Related Topic