avoid files to be attached to cases multiple times - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Thorsten HilgersThorsten Hilgers 

avoid files to be attached to cases multiple times

Hi Community,

i was wondering if somebody has an idea to avoid the following:

We have enabled "Save Email-to-Case attachments as Salesforce Files", because it happens quite often that we need to forward files (debugs, screenshots) from the original error mail internally and saving and again uploading those files simple creates to much overhead. But due to this those files will be again attached to the case when sending them via mail from that case. Same happens when there are inline images used (in email signatures for instance). We have couple of cases with a lot of mail traffic going back and forth and having those "companylogo.png" file attached multiple times, making the files section of a case very confusingly.

Looking forward to your replys / ideas.

Regards

Thorsten
Best Answer chosen by Thorsten Hilgers
Guy KeshetGuy Keshet
Hi Thorsten
Firdt - you're not the only person to encounter this issue, have a look at the ideas section and you'll find a few people complaoining about the same issue

currently the only available solution is code:
option 1: amend the emailHandler apex class that is created automatcailly, to handle attachment creation including checking for duplicates (your developer can look at this thread a an example: https://developer.salesforce.com/forums/?id=9060G0000005ZrpQAE)
option 2: right a trigger on the attachment object . to remove duplicite files (by finding files of the same name and size, attached to the same record)
 

All Answers

Guy KeshetGuy Keshet
Hi Thorsten
Firdt - you're not the only person to encounter this issue, have a look at the ideas section and you'll find a few people complaoining about the same issue

currently the only available solution is code:
option 1: amend the emailHandler apex class that is created automatcailly, to handle attachment creation including checking for duplicates (your developer can look at this thread a an example: https://developer.salesforce.com/forums/?id=9060G0000005ZrpQAE)
option 2: right a trigger on the attachment object . to remove duplicite files (by finding files of the same name and size, attached to the same record)
 
This was selected as the best answer
Thorsten HilgersThorsten Hilgers
Hi Guy,

thanks for info, think i will take a look at the second option. If you have related idea at hand please forward the link so that we can vote accourdingly. Was not able to find sth. maybe i did not use the proper search topics.

BR

Thorsten
Guy KeshetGuy Keshet
Happy to help
I found this idea: https://success.salesforce.com/ideaView?id=08730000000kzK2AAI
there's some other ideas but they also deal with duplcaite emails (eg when you CC others and they also reply)

If my answer has been helpful please close the thread by voting for the best answer