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
shsimsshsims 

Copy outbound email message attachments to case (triggers on Attachment don't seem to fire)

 

I need to have all attachments on case emails copied onto the case itself. 

 

Incoming emails with attachments that come in via Email-to-Case are dealt with by a trigger on attachment after insert.  This is working fine. 

 

However, outgoing emails with attachments that are sent from the case's 'Send an Email' button never trip the attachment trigger.  I have tried using a trigger on EmailAttachment, but it seems like the attachment isn't inserted until later, or is somehow otherwise unavailable.

 

As a simple test, I disabled everything but this:

 

trigger attachmentTest on Attachment (after insert)

{

    for (Attachment att : trigger.new)

    {

         System.debug('\n\n' + 'attachmentTest fired with Id ' + att.Id + '\n\n');

    }

}

 

I see the debug message for the incoming email with attachment, but never see it for the outgoing email with attachment.  Does anyone know a reason for this behavior?  Is there a workaround?

 

Thanks,

Steven

 

Donald BlayDonald Blay
I realized this post is old, but I'm having the exact same issue actually.  Have you ever found a resolution for this?