You need to sign in to do that
Don't have an account?
Send Chatter private messages in Apex code
Hi All,
How to send chatter private messages from Apex code? Any example code ?
Thanks in Advance
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
Hi All,
How to send chatter private messages from Apex code? Any example code ?
Thanks in Advance
Hi chamil,
use feeditem to insert message into the chatter objcet.
sample code is below::
List<FeedItem> feedItems = new List<FeedItem>();
for (Case cas: Trigger.new) {
FeedItem fitem = new FeedItem();
fitem.ParentId = cas.id;
fitem.LinkUrl = '/' + cas.id; //This is the url to take the user to the activity
fitem.Title = 'View'; //This is the title that displays for the LinkUrl
fitem.Body = ((Trigger.isInsert)? ' New Case has been Created ' : ' Case has been updated')
feedItems.add(fitem);
}
//Save the FeedItems all at once.
if (feedItems.size() > 0) {
Database.insert(feedItems,false); //notice the false value. This will allow some to fail if Chatter isn't available on that object
}