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

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

You may also like

Leave a Comment