I am trying to Revise "Send An Email" button on Cases,When the Agent hits "Send An Email" button,any attachments associated to the case should get listed in the Attachment sections and agents get the option to choose which ones to attach in outgoing mail. Is it Achievable? I have not started working on it, its still in research mode. I got stuck when, the requirement came to the point where in attachment section of email page, client wants to add all the attachments associated to the case Listed there.They want to just select the file from this list and attach it to the email. Now my concern is whatever file I upload in general in Attachment related list, it's content gets assigned to Body field of attachment. I am stuck here, because there is no physical file I see instead I see content in the body field. Now I am trying to find where the files I upload in attachment related list gets stored, if I get that, then I can query it to get the list in Attachment section of send email. Is my approach correct?

  • 3
    At first blush, this does sound possible. You'll generally get a better response (upvotes, or at least no downvotes) if you can edit your question to show us the work that you've done so far and point to a specific issue that you're having in trying to implement this. This site isn't a code-writing service so, as-is, this question is more broad than most of the contributors here would like. – Derek F Dec 27 '17 at 14:52
  • If you're new to Salesforce, or to writing Apex/Visualforce pages, the general suggestion is to hop over to trailhead.salesforce.com (which is much better suited than this site is to learning the basics of new concepts). If your abilities are beyond that, you will get a better response by breaking this question into several, more specific ones. For example, "How do I query records related to the one where I pressed a custom button on?" or "How can I allow people to select multiple related records on a visualforce page?" Also, don't forget to search for similar questions before asking your own. – Derek F Dec 27 '17 at 14:58
  • To be very clear,Is it possible to use attachments from attachments related list in send email. If person A attached some files to case in attachments. IF he click on send email button, to attach these files first he need to download files on local machine and then he can select to attach. But is it possible to select attachments from attachments directly without downloading it? Thanks in advance :) – kirti V Dec 28 '17 at 11:19
  • Actually this is a very good question because it comes from the needs of the staff that use Salesforce all day long and every day. The requirement to download the attachments is a big headache and is so open to mistakes and clutters the user's hard drives with 100's of files they have to manage. I am currently working on solving this very much the way @gNerb suggests but doing it in lightning. When I'm done I hope to put the code into a github repo and share the solution. Along the way I'm going to answer many other user requests too. – Bryan Jun 18 '18 at 3:12

Disclaimer - this answer is for SF Classic, there may be a better solution in lightning.

I did something like this in the past but it took a ton of work. Basically, we had to override our case detail and edit pages with visualforce pages as we needed to get access to pieces of the page that the default page would not give us access to. We used the Apex:detail and apex:related list tags for most of it but some lists (comments and email) we manually coded out and used SFDC's stylesheets for the look. Then we removed the Send an email button completely.

Than, we did a custom visualforce page for the edit page that was more like a wizard to walk reps through the process for adherence and after placing a comment they were given an option to send an email using the comment text as the body and we presented a list of attachments with checkboxes for the reps to select attachments.

Then via apex we manually inserted the emailMessage record and associated it to the case and sent a single email message with the case thread ID attached so that responses would come back through the email handler.

So yes.. it's achievable; however, the solution can kind of spiral out of control and this is a 100% dev solution making it somewhat costly and time consuming to implement.

I believe there is a managed package called Email to Case Premium that also has this functionality (Slide 7).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.