• Shobhit Jain 7
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Could someone throw light on this what could be the issue in this trigger? JFYI it gives below error 
Apex trigger t2 caused an unexpected exception, contact your administrator: t2: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, t2: maximum trigger depth exceeded Case trigger even

trigger t2 on Case (after insert)
{
  List<case> chcase = new List<case>();
  for (Case c: trigger.New)
  {
    Case child = new Case(ParentId = c.Id, subject = c.Subject);
    chcase.add(child);
  }
  insert chcase;  
}