Salesforce: Upgrading from FeedPost to FeedItem

When you develop application for Salesforce platform, it often happens that if you validate your changeset on one day it wouldn’t necessary succeed on the next day.
Another situation happened for me this Monday.
11 test methods failed when I tried to deploy to production which validated perfectly during several weeks before and, of course, on the last Friday.

The error was following:

System.DmlException: Insert failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, common.exception.SfdcSqlException: ORA-06550: line 1, column 14: PLS-00302: component ‘GET_CUSTOMOBJECTFEED’ must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored This almost certainly means your PL/SQL is out of sync with your Java, and you should re-sync one or the other. This almost certainly means your PL/SQL is out of sync with your Java, and you should re-sync one or the other. This almost certainly means your PL/SQL is out of sync with your Java, and you should re-sync one or the other. {call cFeeds.get_customobjectfeed(?,?)} {call cFeeds.get_customobjectfeed(?,?)}: []

I have consulted with my colleagues and they told me that these errors with ORA prefix could raise from inner Oracle database used by Salesforce so these could be internal Salesforce errors. Since we don’t have access to inner Salesforce implementation it didn’t look like we could ever fix this.

So I have asked our client to refer to Salesforce inner support to investigate that. We received an answer that we use FeedPost object which is deprecated and should not be used in Summer’14 version (#31).

This object is really marked as deprecated and as available from version 17 to 21 but this didn’t raise any test errors until Summer’14. On Spring’14 version it was quite ok to have apex classes versioned by 19 or 20 version having references to FeedPost object. On Summer’14 this causes errors shown above.

Not sure if anyone is going to fight with these problem, but just for reference I will show here main changes which I have done to upgrade from FeedPost to FeedItem.
Generally I had to replace all occurrences of FeedPost, UserFeed or NewsFeed to FeedItem.
Also I had to remove any filtering query by body. FeedPost object supported filtering by body in WHERE clause while FeedItem doesn’t support this. Any feedpostidI had to change to Id; also, version of each class has to be changed from 19 or 20 to latest 30 or 31.
Some other complex changes have to be done in other cases.

This entry was posted in Chatter, FeedItem, FeedPost, Posts in English, salesforce, upgrade and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s