The customer requirement involves a user being able to provide a date range to identify a set of custom object records. For all object records that fall within that date range (assuming the Created Date is used to filter), the system should then assemble all the records' attachments and provide an output to download (zip or PDF).

Any thoughts?

Data export really won't cut it here because the user needs to be able to specify a dynamic date range to filter records such as the records created in the last 7 days, last 30 days, etc.

2 Answers 2


RE: A Zip File Approach.

If a Zip file is OK and your happy to drive a solution via Visualforce page (client side processing). Then this Visualforce component library around the JSZip library will do what you want.

The demonstration on this blog shows unzipping and zipping (from attachments on a record) via an Office file (which is a zip file as it happens), using ZipFile custom object with attachments, however this the library itself is not bound to a specifc custom object, this is just an example one used in the blog.

NOTE: The resulting Zip file is sent back to VF page controller in the demo, however you could leave it on the client and use the JavaScript File IO libraries built into most browsers to save the file directly. Depending on the size of the resulting zip this will avoid any upload governors kicking in.

<c:zipfile name="someZipfile" state="{!ZipFile__c.Id}" 
   <apex:repeat value="{!paths}" var="path">
     <c:zipentry path="{!path}" base64="true"/>

 public static String getZipFileEntry(String path, String state)

enter image description here


What you're describing was part of a custom app challenge/contest recently on CloudSpokes. I don't believe you'll currently find any native SF support for what you're seeking. Here's a link to the detail page for that challenge which was called Search and Select Content and Attachments and Save Preferences. Reading what they did should provide you with some good thought material on how to approach creating a solution that might suit your organization's specific needs.

If what CloudSpokes did looks like it would suit your particular needs, you might want to contact them about purchasing a license for the winning entry's code rather than writing your own version entirely from scratch.

  • thank you for the link. My colleague posted a similar question here: salesforce.stackexchange.com/questions/4923/… Can this approach be used to return the SOQL results to something other than an email? I will review the cloudspokes site. Apr 16, 2013 at 13:37
  • Yes, I see no reason that you couldn't create a VF page and controller to display the results of the SOQL query. That having been said, using JQuery and the DataTables JQuery plug-in would seem to me to be far simpler solution. Of course, YMMV on that one.;)
    – crmprogdev
    Apr 16, 2013 at 19:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .