ConnectApiHelper icon indicating copy to clipboard operation
ConnectApiHelper copied to clipboard

Error: Compile Error: Method was removed after version 35.0: postFeedElement at line 109 column 40

Open mhumpolec opened this issue 8 years ago • 1 comments

I'm getting error when adding the class into my instance with API 40.

mhumpolec avatar Sep 27 '17 19:09 mhumpolec

It looks like the last paramater is no longer used.

Try this instead.

return ConnectApi.ChatterFeeds.postFeedElement(communityId, input);

From: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_ConnectAPI_ChatterFeeds_static_methods.htm

In version 36.0 and later, this method is no longer available because you can’t create a feed post and upload a binary file in the same call. Upload files to Salesforce first, and then use postFeedElement(communityId, feedElement) to create the feed post and attach the files.

moldar2 avatar Oct 10 '17 19:10 moldar2