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

Email attachments automatically be added to case attachments?

Hi All,

I need a help on this requirement when a customer sends an attachment to an email to case, the attachment remains in the email section but the client wants that the attachments should be automatically uploaded as a Case Attachment & not just related to the email message. Can we do that?

If yes, can you please  send me a working code? Thanks for help.

~ Abhi
Best Answer chosen by Adda
Here is the appexchange:

All Answers

You might be able to do this by writing a trigger on EmailMessage that if the ParentId is of a Case then clone the Attachment record and change it's ParentId to be that of the case instead of the EmailMessage.  You could try to just change the ParentId of the Attachment record, but I do not believe that you can change that after creation.
Thanks pcon for reply.

I got a code that works perfectly from appexchange. 

Here is the appexchange:
This was selected as the best answer