function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vasu takasivasu takasi 

how to insert a feedItem from trigger

the beloecode showing exception like



trigger acc on FeedItem (after insert)
FeedItem post = new FeedItem();
post.ParentId ='0019000000GuVUM';
post.Body = 'welcome';





How to solve it.


Your code is correct.


Does the user have permission to write on the chatter feed for the ParentId you have hard coded?

vasu takasivasu takasi

how to check user permissions..?

please give me reply.


Go to the page for 0019000000GuVUM and see if you can post to that chatter feed.