You need to sign in to do that
Don't have an account?
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