• kirankumarreddy punuru 10
  • NEWBIE
  • 5 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
Hi ,

  I am trying to copy data from a standard object to a custom object through trigger and i have written one trigger for this please help in this trigger wheather this is correct or i need to change .My trigger is:
 

trigger chatterComments on FeedComment (after insert) 
{    List<FeedComment__c> customObj = new List<FeedComment__c>();
    List<FeedComment> standardObj = new List<FeedComment>();
   lststandardObj =[Select id,CommentBodyfrom FeedComment];
    
    for(FeedComment fc:lststandardObj){
        FeedComment__c  fc1 = new FeedComment__c();
        fc1.CommentBody__c = lststandardObj.CommentBody;
        customObj.add(fc1);
    }
    if(customObj.size()>0){
      insert  customObj;  
    }
      
}
Hi ,
Iam getting this email can some one tell me why this is occuring .

Subject: Developer script exception from eClerx : 'EloquaTaskUpdater' for job id '7073300002b878v' : Update failed. First exception on row 0 with id 00T3300004b9UhnEAE; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, TaskBeforeTrigger: execution of AfterUpda...
 
Apex script unhandled exception by user/organization: 005400000014PEF/00D400000009JYK
 
Failed to process batch for class 'EloquaTaskUpdater' for job id '7073300002b878v'
 
caused by: System.DmlException: Update failed. First exception on row 0 with id 00T3300004b9UhnEAE; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, TaskBeforeTrigger: execution of AfterUpdate
 
caused by: System.ListException: Duplicate id in list: 00Q3300001CWdkCEAT
 
Trigger.TaskBeforeTrigger: line 71, column 1: []
 
Class.TaskHandler.eloquaTaskHelper: line 30, column 1
Class.EloquaTaskUpdater.execute: line 20, column 1
Subject: Developer script exception from eClerx : 'EloquaTaskUpdater' for job id '7073300002b878v' : Update failed. First exception on row 0 with id 00T3300004b9UhnEAE; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, TaskBeforeTrigger: execution of AfterUpda...
 
Apex script unhandled exception by user/organization: 005400000014PEF/00D400000009JYK
 
Failed to process batch for class 'EloquaTaskUpdater' for job id '7073300002b878v'
 
caused by: System.DmlException: Update failed. First exception on row 0 with id 00T3300004b9UhnEAE; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, TaskBeforeTrigger: execution of AfterUpdate
 
caused by: System.ListException: Duplicate id in list: 00Q3300001CWdkCEAT
 
Trigger.TaskBeforeTrigger: line 71, column 1: []
 
Class.TaskHandler.eloquaTaskHelper: line 30, column 1
Class.EloquaTaskUpdater.execute: line 20, column 1

regards,
kiran
 
Hi ,
Can some one tell me how to delete the comment from the chatter post if the post contains specific keywords in the set.any ideas?

Regards,
Kiran
Hi ,

  I am trying to copy data from a standard object to a custom object through trigger and i have written one trigger for this please help in this trigger wheather this is correct or i need to change .My trigger is:
 

trigger chatterComments on FeedComment (after insert) 
{    List<FeedComment__c> customObj = new List<FeedComment__c>();
    List<FeedComment> standardObj = new List<FeedComment>();
   lststandardObj =[Select id,CommentBodyfrom FeedComment];
    
    for(FeedComment fc:lststandardObj){
        FeedComment__c  fc1 = new FeedComment__c();
        fc1.CommentBody__c = lststandardObj.CommentBody;
        customObj.add(fc1);
    }
    if(customObj.size()>0){
      insert  customObj;  
    }
      
}