I have a trigger that should create a new event after insert or after update of a custom object called Handoff, but only if a custom field (Status) of that new record = "Delivered"

The after insert portion works fine, but the after update portion seems to always create duplicate events (two, to be precise).

I can't quite seem to find where it's going wrong within the trigger... any ideas?

trigger CreateEventAfterHandoff on Handoff__c (after insert, after update) {

List&lt;Event&gt; lstNewEvents = new List&lt;Event&gt;();

for (Handoff__c eve : Trigger.new) {

    if (Trigger.isUpdate) {

        if (eve.Status__c != Trigger.oldMap.get(eve.Id).Status__c) { 

        // Field has been changed! 

            if (eve.Status__c == 'Delivered') {

                Event e         = new Event();

                e.Event_Type__c     = eve.Event_Type__c;
                e.Meeting_Type__c   = eve.Meeting_Type__c;
                e.StartDateTime     = eve.Meeting_Time_Start__c;
                e.EndDateTime       = eve.Meeting_Time_Stop__c;
                e.Subject           = eve.Name;
                e.WhoId             = eve.Lead__c;
                e.OwnerId           = eve.User__c;
                e.Handoff_ID__c     = eve.Id;

                lstNewEvents.add(e);

            }           

        }

    } else if (Trigger.isInsert) {

        if (eve.Status__c == 'Delivered') {

            Event e         = new Event();

            e.Event_Type__c     = eve.Event_Type__c;
            e.Meeting_Type__c   = eve.Meeting_Type__c;
            e.StartDateTime     = eve.Meeting_Time_Start__c;
            e.EndDateTime       = eve.Meeting_Time_Stop__c;
            e.Subject           = eve.Name;
            e.WhoId             = eve.Lead__c;
            e.OwnerId           = eve.User__c;
            e.Handoff_ID__c     = eve.Id;

            lstNewEvents.add(e);

        }

    }           

}

insert lstNewEvents;     

}



Question: Do headset and frame metals need to match, or will a steel/aluminum headset get stuck on an aluminum/steel frame?
Answer: Seatposts have a relatively long length inside the tube, and no way to get a tool to the bottom of the post to hammer it. If you have a proper headset remover tool, I doubt a headset would ever get so stuck. (Even without the proper tool, it's unlikely to be a problem.)

Also, I don't believe there's such a thing as a headset with an alloy bearing race. So if it has alloy cups, they probably have replaceable bearings that fit inside it, so the cups shouldn't ever need replacing.