You need to sign in to do that
Don't have an account?
HugoNow
Connect API - postFeedElement - Implementation restriction exception
Hi all,
I am having quite a bizarre problem.
I have code inside of a trigger that does a Chatter post when a condition is met.
When executed by an admin, everything is okay. But when it is executed by a user with a Chatter Only license, I get the error:
ConnectApi.ConnectApiException: FeedItemContentRevisionControl: execution of BeforeInsert caused by: System.QueryException: Implementation restriction: FeedItem requires a filter by Id Trigger.FeedItemContentRevisionControl: line 52, column 1 Class.ConnectApi.ChatterFeeds.postFeedItem: line 6395, column 1
However, when I bypass the ConnectApi and insert directly a FeedItem, it works
I tried removing the 'with sharing'. I tried adding 'without sharing'. I upgraded my version to v35. I tried replacing the 'me' with UserInfo.getUserId(). I tried to find if there was a permission or configuration associated but to no avail.
Anyone has ideas about this? It this a bug?
Thanks
I am having quite a bizarre problem.
I have code inside of a trigger that does a Chatter post when a condition is met.
ConnectApi.ChatterFeeds.postFeedElement(Network.getNetworkId(), 'me', ConnectApi.FeedElementType.FeedItem, 'It is ready!');
When executed by an admin, everything is okay. But when it is executed by a user with a Chatter Only license, I get the error:
ConnectApi.ConnectApiException: FeedItemContentRevisionControl: execution of BeforeInsert caused by: System.QueryException: Implementation restriction: FeedItem requires a filter by Id Trigger.FeedItemContentRevisionControl: line 52, column 1 Class.ConnectApi.ChatterFeeds.postFeedItem: line 6395, column 1
However, when I bypass the ConnectApi and insert directly a FeedItem, it works
INSERT new FeedItem(ParentId = UserInfo.getUserId(), Body = 'It is ready!');I have searched around and I am not able to find a solution for this. I would like to use the ConnectApi as I have requirements for its features that I cannot do through an insert of the FeedItem.
I tried removing the 'with sharing'. I tried adding 'without sharing'. I upgraded my version to v35. I tried replacing the 'me' with UserInfo.getUserId(). I tried to find if there was a permission or configuration associated but to no avail.
Anyone has ideas about this? It this a bug?
Thanks
Have you checked any other system permission is required to setup in the profile for the line which is throwing the exception?