function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
TNiemanTNieman 

I need a case insert trigger

I need a new Case Insert Trigger code and we already have 
trigger CaseAfter on Case (after delete, after insert, after undelete, after update)

I only need "after insert" with some specific conditions (a particular account type to add a predefined Case Team) .  Should I created a new trigger or update the exisiting and a separate processing for the specific "after insert" I need?

Tom
Best Answer chosen by TNieman
Akhil ReddyAkhil Reddy
Hi, 
It is recommended to use single Trigger for an object because it makes debugging easy and easy add on future fucntionality.
in this case you should use trigger context variable 
if (isInsert){
    if (isUpade){
   }
}

if (isUpdate){
    if (isUpade){
    }
}

 

All Answers

Akhil ReddyAkhil Reddy
Hi, 
It is recommended to use single Trigger for an object because it makes debugging easy and easy add on future fucntionality.
in this case you should use trigger context variable 
if (isInsert){
    if (isUpade){
   }
}

if (isUpdate){
    if (isUpade){
    }
}

 
This was selected as the best answer
TNiemanTNieman
Thanks Akhil, that's kinda what I thought