+ Start a Discussion
NikhilNikhil 

Trigger on attachment object does not works on AfterInsert event

Hi All,

I created a trigger on Attachment object and event used is afterInsert,afterDelete

Sample Code
-------------------
trigger abc on Attachment (after insert, after delete) {
   
    if (Trigger.isAfter && Trigger.isInsert)
    { 
        // Block 1
    }
     else if (Trigger.isAfter && Trigger.isDelete)
    {
         // Block 2
     }

}

here trigger successfully  executes "Block2" when i update the attachment but it doesn't executes "Block 1" when a new attachmeent record is created

So trigger is not responding on  <after Insert> event

Please suggest ASAP

Thanks

MakMak
Hi Nikhil,

I am facing the same problem. Attachment trigger works on update but not on insert.
DO you happen to have any updates on this?

Thanks
NikhilNikhil
No result so far ..
shan876shan876
Did you ever get this to work?? If so, how??
MakMak

No Shan, i couldn't get it to work

 

There are so many posts on this issue on the forum but surprisingly no one from salesforce has ever commented.