You need to sign in to do that
Don't have an account?
Alistair Field 8
How can I automatically add a topic to a certain feed type.
I would like to automatically add a topic to Question asked in the Community.
I have the following apex trigger that works for all posts. But I would like to add in a statement that ONLY makes it works on Question type posts on a community and not internal org.
Thanks in advance.
I have the following apex trigger that works for all posts. But I would like to add in a statement that ONLY makes it works on Question type posts on a community and not internal org.
Thanks in advance.
trigger AddingQtopic on FeedItem (after insert) { List<TopicAssignment> taList = new List<TopicAssignment>(); for(FeedItem c : trigger.new){ TopicAssignment ta = new TopicAssignment(); ta.TopicId = '0TO400000000NCE'; ta.EntityId = c.Id; taList.add(ta); insert taList; } }
Please find sample code for question type posts.