You need to sign in to do that
Don't have an account?
Carolina W 2
How can I change the FeedItem's sender?
Hi!
In the case of the image, the user Alanna Clark updated an account and my trigger runned and posted the FeedItem.
But I want to change the sender ("Alanna Clark") for another the user called "INTERFACE" when the trigger runs. What do I have to do?
//Feed Post FeedItem post = new FeedItem(); post.Body = 'Msg body'; post.ParentId = acc.Id ; insert post;
You need to run 'Feed Item' insertion code as "Interface" user, it needs to be moved out of trigger.
Try Somthing like this :
You can mark some checkbox or field data which can identify that you need to insert Feed Item for particular record in trigger and then 'Feed Item' insertion can be done using Scheduled Job (Run as "Interface" user, Async process).
Thanks
Try this:
You can set the user that posted the message by adding the userId here If you found this answer helpful, please mark it as the best answer to help others.