I need to write trigger when user Post comment from chatter Post, Update the Accounts field Subject__c with chatter comments.For that I wrote a trigger but It is not working. I am new to salesforce. Please help in this trigger.
trigger FeedCommentUpdate_Account on FeedComment(after Insert, after Update) {
Map<Id, feedComment> mapId = new Map<Id, FeedComment>();
for(FeedComment fc : trigger.new){
mapId.Put(fc.ParentId, fc);
}
List<Account> accList = [select Id,last_Completed_Date_Time__c ,Subject__c, Link__c from Account where ID =: mapId.KeySet()];
for(Account acc : acclist){
if (mapId.containsKey(acc.Id)){
acc.last_Completed_Date_Time__c = system.now();
acc.Subject__c=mapId.get(acc.Id).FeedItemId;
}
}
Update accList;
}`
`