You need to sign in to do that
Don't have an account?
BPeddle
Adding a link to a FeedPost
I suspect I am over looking something simple. I am trying to insert a Link into a Feed Post and can't seem to do it. Example:
FeedPost post = new FeedPost();
post.Body = 'Hey now! <a href="http://google.com">Google</a>';
post.parentid = UserInfo.getUserId();
insert post;
FeedPost post = new FeedPost();
post.Body = 'Hey now! <a href="http://google.com">Google</a>';
post.parentid = UserInfo.getUserId();
insert post;
Is this possible?
This will solve my problem for now. Thanks!
FeedPost post = new FeedPost();
post.Type = 'LinkPost';
post.Title = 'Google';
Post.LinkURL = 'http://www.google.com';
post.Body = 'This is the body, hey now!';
post.parentid = UserInfo.getUserId();
insert post;
All Answers
FeedPost has a LinkUrl property that you can use for this. I've also been able to add links using the raw URL, but I don't think anchor tags will work as that requires something to render the HTML.
This will solve my problem for now. Thanks!
FeedPost post = new FeedPost();
post.Type = 'LinkPost';
post.Title = 'Google';
Post.LinkURL = 'http://www.google.com';
post.Body = 'This is the body, hey now!';
post.parentid = UserInfo.getUserId();
insert post;