• mp3high yt
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
I can't get a test class to work for a Trigger that is only looking for when a Case Comment is Updated.

trigger validation on CaseComment (before update) {  
    if(Trigger.isUpdate){
        for(CaseComment caseCmt : Trigger.new){
            if(caseCmt.CreatedById != System.UserInfo.getUserId()){
                caseCmt.addError('You can not edit Someone else\'s Comment');
            }
        }
    }
}

Any Help/Advice would be appreciated:)