Partager via


Drag n Drop Upload Control for Dynamics CRM 2013

Almost a year ago I was working on a PoC to demonstrate Microsoft Dynamics CRM 2011’s amazing new capabilities. One of the requirement of the PoC was to showcase drag-n-drop upload of documents. I wanted to deliver a quick PoC hence the code doesn’t handle all the scenarios, but it will give you a basic idea of how to provide such a feature on any of CRM Entity Forms. Also I have migrated the script to work with Dynamics CRM 2013.

Features

  • Simple to setup
  • Handles basic validations
  • Refreshes the Notes control after files are uploaded
  • Tested with Dynamics CRM 2013(Will work with Dynamics CRM 2011 with minor changes in the script)

Setup Instructions 

  • Download the solution from here.
  • Import the solution in your CRM Instance where you would want to enable this functionality
  • Open the Entity form in From Designer Mode
  • Insert a Web Resource and point it to the Main.htm file as shown below:

 

  • Click on Ok. Save and Publish the Form.
  • Navigate to form and you will see an area on the form as shown below(depending upon how and where you have placed the upload control this may vary):
  • If there is any validation failing a message will appear under the drag and drop area.
  • Enjoy!!!

For those who are interested in details this control can save you minimum 6 clicks. I am sure anyone from Telco/Contact Center background would know how less number of clicks means more revenue/or less investment. Please note that I do not take any responsibility whatsoever for the solution published. Use it at your own risk. On the other hand if you find any challenge implementing this solution, do leave me a comment and I will try to help.

Comments

  • Anonymous
    October 06, 2014
    The comment has been removed

  • Anonymous
    February 03, 2015
    This does not work with CRM 2015 because you are using "getServerUrl()". Changing the code to use Xrm.Page.context.getClientUrl() would work.

  • Anonymous
    February 09, 2015
    Will it work with CRM 2015?

  • Anonymous
    February 12, 2015
    Super, feeling happy yo work on this solution.

  • Anonymous
    February 28, 2015
    Hi, I tried the steps you mentioned above. Im using CRM 2011 and in the form customization I inserted as the webresource  and published, but when I come to view of the form it is not showing anything..Is this supported in CRM 2011?Please help

  • Anonymous
    March 08, 2015
    hi....while importing the solution it shows some error..CRM List of possible elements expected Is Customizable Can Be Deleted Is Hidden....et.c,etc., any help..the file upload is very important and reqd control...for us...pls help

  • Anonymous
    March 08, 2015
    First of all, I am really sorry for responding so late to your comments.@Jan: Thanks. I am publishing a better version on CodePlex soon and shall fix it.@Vince: As mentioned by Jan, it will not work with Dynamics CRM 2015.@Muhammed: To make it work with CRM 2011, you have to make some changes in it. The original version targeted CRM 2011 only but this version targets CRM 2013(at the time of writing this post Dynamics CRM 2013 was the latest version).@Bhavusuresh: Could you please provide more details on the environment you are using and Dynamics CRM version as well?

  • Anonymous
    March 10, 2015
    this is disable while creating records.it is working after saving that if you open again it is workingplease tell me how to enable that while creating also

  • Anonymous
    March 11, 2015
    Ram: That is by design. When a record is not saved, you can not add notes to it.

  • Anonymous
    March 17, 2015
    The comment has been removed

  • Anonymous
    March 19, 2015
    Hi Sushil,Could you please post more details like your environment and maybe a link to the screenshot?

  • Anonymous
    March 27, 2015
    As promised, the updated version is available at: crmdragndrop.codeplex.com

  • Anonymous
    April 01, 2015
    Hi I have added your updated web resource to one of our forms in CRM 2015 and it is showing the message "Upload is disabled for this form type". Do you have any more information about this error?

  • Anonymous
    April 02, 2015
    Hi Had-Jay,That is not an error message. This control doesn't work if the record is not already created i.e. when you are creating the record it will not allow you to upload files.

  • Anonymous
    April 14, 2015
    Hi, i darg 2 files in the email form , i have the message :   Processing crm.txt Uploaded crm.txt Successfully. but when i refresh or i save my form this file i can't find it anywhere any idea ?

  • Anonymous
    May 19, 2015
    You could always change the js message in the solution from "Upload is disabled for this form type." to something like "Please save your record before uploading files." to try to idiot-proof this for end users... "save THEN attach, otherwise there's nothing to attach things TO" still confuses many of my users :-) Chinmay - this is excellent, many thanks!

  • Anonymous
    May 19, 2015
    Hi Ramzy, This particular control uploads files to Notes only. If you want email attachments then check crmdragndrop.codeplex.com Hi Frank Thank you very much for you comments. And about changing the message, consider it done in a next release. Also please note that I have upgraded the entire project and have moved it to CodePlex. You can check the latest version(with Email Attachment Support) here: crmdragndrop.codeplex.com Please do leave your feedback/comment once you have tried the new version. Regards, Chinmay.

  • Anonymous
    June 10, 2015
    hi all, when i tried to upload its,shown me message. Processing sheduler.txt File sheduler.txt was not uploaded. Please Contact your System Administrator. please,suggest me what's wrong here.I am using  MSD 2015 Thanks

  • Anonymous
    June 12, 2015
    Hi Rahul, Kindly use the newer version available at: crmdragndrop.codeplex.com From downloads area you can get the version that will work with Microsoft Dynamics CRM 2015. Regards, Chinmay.

  • Anonymous
    August 11, 2015
    The comment has been removed

  • Anonymous
    November 12, 2015
    The comment has been removed

  • Anonymous
    December 27, 2015
    Hi Alex, Sorry for the delay in responding to this comment. If you still have the requirement for CRM 2011 I can try to create one otherwise you can check the code and use it on your own. Code is not minified nor obfuscated. Regards, Chinmay.

  • Anonymous
    December 27, 2015
    There are many reasons while a file upload fails. From file size to mime-type mismatch. It is difficult for me to comment without having more details.

  • Anonymous
    December 27, 2015
    Hi Chinmay, Amazing POC!!! works fine for me, except file size exceeds 25 MBs. As MSCRM 2015 allows 32 MB attachment in notes. So if I drag file of size > 25MB then I get error 'Out of Memory'. Any Idea about this

  • Anonymous
    December 27, 2015
    Hi Apurv, I am not sure if this message is coming from the Framework or the browser itself. I have published the latest one on: crmdragndrop.codeplex.com I suggest you try the latest version. The one published here is for Dynamics CRM 2013. Regards, Chinmay.

  • Anonymous
    December 30, 2015
    Chinmay Thnx for replying :) Error message is given bey browser it self. Your framework converts file into a base64string so when file size is 25 MB+ then base64string goes too large. As result of this we XMLHTTPRequest can't be send so Out of memory issue is observed. I am not sure if we can use MSCRM method to upload file. Thanx

  • Anonymous
    January 01, 2016
    Thank you chinmay!! Error message is coming from browser. As your framework converts file in to a base64string. When file size goes 25MB+ then base64string becomes too large hence ''Out of Memory'exception is thrown. So Can you please suggest any alternative to handle large files upload. Thnx. P.s. Wish you a happy new year!!!

  • Anonymous
    January 11, 2016
    Thanks Apurv and Happy New Year. I am sorry but I do not have any workaround for this particular limitation.

  • Anonymous
    January 12, 2016
    Hi. Does this only work with on premise?

  • Anonymous
    February 10, 2016
    hi all, when i tried to upload its,shown me message. Processing sheduler.txt File sheduler.txt was not uploaded. Please Contact your System Administrator. i also update new version for 16- crmdragndrop.codeplex.com/.../1533101 please,suggest me what's wrong here.I am using  MSD 2016 Thanks

  • Anonymous
    February 17, 2016
    Hi Chinmay, could you please provide me with the solution for CRM 2011?  I have extremely minimal coding skills and probably wouldn't be able to figure out the tweaks to make.  This solution is exactly what we are looking for. Thanks!

  • Anonymous
    February 18, 2016
    Hi Jan, but where i will change this: This does not work with CRM 2015 because you are using "getServerUrl()". Changing the code to use Xrm.Page.context.getClientUrl() would work. fileupload control is managed solution so can't customize  in any JS file  and html page

    • Anonymous
      June 30, 2016
      crmdragndrop.codeplex.com -------This is superb working properly thank you for this.......
  • Anonymous
    March 15, 2016
    Hi, Why is it not possible to drag and drop attachments directly from Outlook to records in CRM?I first have to save the attachment locally and only than I can drag and drop it to CRM.

  • Anonymous
    December 13, 2016
    Got similar error as Akram in CRM 2016:An error occured during file upload: Object doesn't support property or method 'getServerUrl'It has to be switched to getClientUrl in 2016 version.Do you have a more updated version for CRM 2016?

    • Anonymous
      March 07, 2017
      Hi Elisabeth,Please get the updated version from : http://crmdragndrop.codeplex.com/Regards,Chinmay.
      • Anonymous
        July 29, 2017
        This soulution is owrking only while I am attaching files in Notes, can you please share some way outs so that I can use the same solution for attaching files in email attachment.