How to download/export the attachments of the selected rows in a View on the client's machine? RRS feed

  • Question

  • Hi, 

    Can we download all the attachments of the selected records in a View on the client machine? I know it can be done on the server maching where Dynamics CRM is installed, but I want to download the attachments on the server machine. Here's the scenario:

    1. User selects rows in the View in CRM.

    2. User clicks on a custom button to trigger the plugin to download all the attachments (Photo, Files in notes etc.)

    3. A .ZIP folder is available for download, or is downloaded automatically in the Downloads folder that contains the attachments of the selected records in the View. The attachments will be organized in a separate folders for each record. The name of the folder will be the Name of the record. So it will be some thing like this

    Attachments.zip --> Record1, Record2, Record3...(folders)

    Record1(folder)--> Photo.png, file.pdf..etc. 

    Please advise if this is doable for both Online and On-Premise versions.



    Fahad Ali Shaikh

    Sunday, December 6, 2015 7:12 AM

All replies

  • I think the main consideration is how and where you can generate the .zip file. This isn't something I've done, so I don't know the answer, but it would be one of:

    • If the .zip file can generated in javascript. I think this is unlikely, but if it is possible, then you should be able to do the whole process in an HTML web resource, which would work for Online and OnPremise. This would be a lot of work, and you'd have to also convert the Base64 encoding within javascript
    • If the .zip file can be generated by .Net code without using external assemblies. If so, you could use a plugin / custom action to generate the file, which would work on Online or OnPremise. However, you'd probably only be able to trigger the code from the client, and the user would then need to download the results as a separate step
    • If the .zip file can be generated by code that uses either external .Net assemblies, or non-.Net code. If this is the case, I'd probably write it as an ASP .Net application that you'd have to deploy on a web server somewhere (if you have Crm Online, you'd need to host the ASP .Net application somewhere else, such as an Azure server)

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Monday, December 7, 2015 11:17 AM