Skip to Content

TheBlogReaders.com

Salesforce.com, PHP, MySQL, Javascript, Ajax, Htacces

How to add a hyperlink in the body of a feeditem using apex class?

Be First!

How to add a hyperlink in the body of a feeditem using apex class?

FeedItem in salesforce as its represents an entry in the feed, such as changes in a record feed, including text posts, link posts, and content posts.
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_feeditem.htm

Sample Code:
//Adding a Link in FeedItem
FeedItem linkItem = new FeedItem();
linkItem.ParentId = oId; //eg. Account id, Contact Id, Opportunity id, Custom object id, etc
linkItem.Title = ‘TheBlogReaders.com’;
linkItem.LinkUrl = ‘http://www.theblogreaders.com’;
insert linkItem;

See the Screenshot:

FeedItem

(840)

Previous
Next

Leave a Reply