Help & Support
Elevate Your Agents with AgentExchange Solutions
Easily enhance Agentforce with pre-built AI solutions from AgentExchange. Browse, install, and deploy agents, actions, and apps directly into your environment. Tell Me More
Have Questions?
Private ListingThis listing is private and can't be found by searching or browsing AgentExchange.
Email2Case Attachment Reassign
Save Attachments from Email2Case Messages
- Business Need
- Agent Productivity
Moves/copies email attachments on Email2Case emails from the email record to the parent Case record.
Rating
Reputation
MVP
Recognized by Salesforce for their leadership, expertise, and generosity
Top Reviewer
Contribute reviews that encourage conversation and help others make informed decisions
Ranger
Lifelong learners who have earned the Ranger rank or higher on Trailhead
Showing 10 of 23 Reviews
Unsupported API version
The API version for the code is 14, which is no longer supported by Salesforce (or soon to be retired).
Works fine but needs bulkified version (sample code below)
I Also had to enable Enhanced email feature and make similar trigger for ContentDocument to make app work. Set emailIDList = new Set(); for(Attachment a: trigger.new){ if(a.ParentId != null) emailIDList.add(a.ParentId); } List emailList = [select ID,parentID from EmailMessage where id in :emailIDList]; Map emailMap = new Map(emailList); for( Attachment a : trigger.new ) { if( emailMap.containsKey(a.ParentId) ) { a.parentid = emailMap.get(a.ParentId).parentID; } }
Did not work for me
I needed the Email Attachments to be moved from EmailMessage to Case record. So Installed it and for testing, sent an Email-to-Case with attachments. The files were visible on both the case & the EmailMessage. Then deleted the EmailMessage record, and the files were gone.
Shouldn't it move the Attachment to Files?
As part of the overall migration of Notes and Attachments to Files that Salesforce has recommended?
Does What I Need
I see some people don't like that the original email does not retain the attachment - this suites me. Reduces duplicates and keeps storage in check.
Does the job, but...
Yes it moves the files that are embedded inside each case into the attachments section making it easier to find all files, however it actually *moves* the attachments so two things go wrong with this method, files are no longer available in the actual email, 2 the feeds view also loses reference to these attachments. IF this could actually make links to the files and still leave the attachments in the actual emails this would undoubtedly get 5 stars. Install is extremely easy, no config needed, it just works. Send a test email with a couple of attached images and they get moved into the case under the attachments section.
Just installed
I have just installed the app, and I have no idea what bulkify means, but now the attachments appear in the case related list instead of email's. I actually like the fact the attachment is moved and not duplicated. So far, so good. (I'll give 5 and come back if this bulky thing comes around).
Results Case Feed - images do not appear in-line
Following an extensive investigation with SalesForce Support, we found that the Apex Trigger 'Email2Case Attachment Reassign' included in this official 'SalesForce Labs' application, is causing the in-line images in the Case Feed to appear as 'The file is no longer available'. Obviously, this was uninstalled to stop interfering with the feed.
Works perfectly
A little add-on since this trigger detached attachment from email and my customer need to keep it on email and attached it to case : Attachment myduplicate; for( Attachment a : trigger.new ) { // Check the parent ID - if it's 02s, this is for an email message if( a.parentid == null ) continue; String s = string.valueof( a.parentid ); if(s.substring( 0, 3 ) == '02s') { myduplicate=new Attachment(); myduplicate.Name=a.Name; myduplicate.parentid = [select parentID from EmailMessage where id = :a.parentid].parentID; myduplicate.Body=a.Body; insert myduplicate; } }
Works great!
We put this in place to make it easier for our support team and it's worked great! I haven't had any issues with it yet.
Obviously a very late response, but in case it helps anyone, you can save email attachments as Files by checking the box 'Save Email-to-Case attachments as Salesforce Files' in the 'Email-to-Case Settings' setup page.