You need to sign in to do that
Don't have an account?

creating a post with mention via a javascript pushbutton
Hi all, i'm working on a Manual Request pushbutton that send a chatter post to some other user for alerting.
I succesfully create the code, something like this:
var msg='bla bla bla bla';
var cm=new sforce.SObject("FeedItem");
cm.ParentId='{!Opportunity.Id}';
cm.Body=msg;
How can i introduce the mention for user that i need to alert?
Can i put it in msg string directly, like...
var msg='@user bla bla bla';
have to enclose in brakets?
thank you all
i found something in chatter rest api:
it seems that the body can be composed by different part, but how can i do the same without chatter rest api?
Sorry but at this time I believe you can only make new feed items with @-mentions using the Chatter REST API.
Hi Chris,
Do you know if it's possible to add @mentions via Apex or AJAX yet? I know we can do this via the Chatter REST API but has Salesforce added this functionality in Apex/AJAX?
Thanks!!!
Not currently. One workaround you can use is to call into the Chatter REST API from Apex by using Apex's built-in HttpRequest object and JSON parser. I believe you can use the context user's session ID as your OAuth token.