What's even cooler than a Super Bowl ad? In the case of Chatter, its the many new features that come with the Spring 11 release. Quinton Wall (resident Chatter guru), and Rob Woollen (Platform CTO and one of the original Chatter Architects) will be presenting a great webinar on 2/24 that covers the Spring 11 Chatter features from a developer's perspective. It's a can't-miss for any current and future Chatter developer and you can reserve your seat here

In preparation for the webinar (and/or as a way to get started with Chatter development), you can read this 'Introduction to Chatter' article. The article was originally authored by Quinton a while back, but it has recently been revamped and brought up-to-date with Spring 11. Even if you've done some Chatter development in the past (and may have read that article some time ago), I would recommend taking another look at it. There have been significant additions (and some important changes) to the Chatter data model over the past 3 releases and the article is a great way to get up-to-date. In addition, the 'Chatter Recipes' article will also be updated shortly. That article has several code samples for common Chatter development use cases, including several new recipes that cover Chatter triggers and Chatter data migration/integration. 

At the risk of stealing some of Quinton's thunder, I wanted to highlight one important change to the Chatter data model in the Spring 11 release. The old FeedPost object has been deprecated in Spring 11 (though any existing code that references it will continue to be supported for backwards compatibility). In its place is a new object – FeedItem – which represent a single Chatter post. This change has important implications on any Chatter code that you might have developed in the past. Lets take a quick look at two before-and-after snapshots to illustrate the point. 

Querying a user's NewsFeed.

    Before (i.e. prior to Spring 11)

SELECT Id, Type, FeedPostId, FeedPost.Body, FeedPost.Title, FeedPost.CreatedById, FeedPost.LinkUrl FROM NewsFeed ORDER BY CreatedDate DESC, ID DESC LIMIT 20

    After

SELECT Id, Type, Body, Title, CreatedById, LinkUrl FROM NewsFeed ORDER BY CreatedDate DESC, ID DESC LIMIT 20

Adding a new Chatter post.

    Before (i.e. prior to Spring 11)

FeedPost fpost = new FeedPost();
fpost.ParentId = <Object/User/Group Id>;
fpost.Body = 'Same post';
insert fpost;

    After

FeedItem fpost = new FeedItem();
fpost.ParentId = <Object/User/Group Id>;
fpost.Body = 'Same post';
insert fpost;

Again, remember that any existing code that references the old FeedPost object will continue to work as before. All new code should however use the new FeedItem object. Next week's webinar will cover this change and other interesting Chatter development tips and tricks and so make sure its on your calendar.

tagged Bookmark the permalink. Trackbacks are closed, but you can post a comment.
  • http://quintonwall.com Quinton Wall

    Awesome post. I have no thunder, I just hang around with people who know how to make it rain!