• shsims
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

 

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

 

  • September 01, 2010
  • Like
  • 0