0

My question is very simple... Can I post in chatter on behalf on another user i.e. not the context user ?

I didn't find any method in the documentation which allows to override the running user and the field FeedItem.InsertedById is only Filter, Group, Nillable, Sort

2 Answers 2

3

If you insert via the regular FeedItem, you can set the CreatedBy..here's an example for an account post:

FeedItem fi = new FeedItem();
String s = 'Test Message';        

            fi.CreatedById = '0053000000AD9YT';
            fi.Body = s;
        fi.ParentId = '0013000001Gn4BA';
            fi.Type = 'TextPost';
            insert fi;

You can't do this via ConnectAPI at this time though.

0

Using salesforce standard tools you are not able to post on behalf of another user.

But you can utilize the salesforce REST-API and login as a different user via HTTP Callouts..

1
  • that would require updating the other user's password in code/custom setting every time he updates it...
    – ManSpan
    Commented May 22, 2014 at 14:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .