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

Trigger from Chatter to create Ideas in salesforce
My company wants to use a Chatter group to allow employees and customers to submit and comment on new product ideas. I need ot write a trigger so that when a new FeedItem is created on the New Ideas group in Chatter, it creates a new Idea record, linked to the FeedItem. When someone comments on that FeedItem, the new FeedComment updates the Idea object with the comment.
Does anyone have an example of creating a new Idea object each time a new Chatter post occurs?
This is what I have so far, and of course, I get an error just saying that Salesforce has been notified:
trigger createNewIdeaTrigger on FeedItem (before insert) {
//find info and create new Idea object.
for (FeedItem f: trigger.new)
{
Idea newIdea = new Idea(Categories = 'NewIdea', Status = 'New', Body = f.Body, CommunityId = '09a300000004gvG', Title = 'New Idea') ;
f.parentId = newIdea.Id;
newIdea.postID__c = f.Id;
insert newIdea;
}
}