locked
Cannot get jsignature web resource working in CRM 2013 Online RRS feed

  • Question

  • We are trying to use jsignature to capture customer signoff inside CRM, we are trying to follow this tutorial

    http://blogs.msdn.com/b/devkeydet/archive/2014/06/25/capturing-a-signature-in-a-crm-form-using-html5.aspx

    so far we have added the HTML code from that page into a web resource inside CRM Online, and we have also uploaded the js files as well. The code is below.

    <html><head>
         <title>Signature</title>
         <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.1.min.js" type="text/javascript"></script>
         <script src="</script">https://myorg.crm4.dynamics.com//WebResources/new_jsigmin"></script>
     <meta charset="utf-8"></head>
         <body>
             <img id="sigImage" style="display: none;" alt="This is an image of the persons signature.">
             <div id="sigPanel" style="display: none;">
                 <div id="signature"></div>
                 <button id="clear">Clear</button>
             </div>
             <script type="text/javascript">
                 $(function () {
                     var sigImage = $("#sigImage");
                     var sigPanel = $("#sigPanel");
                     var sig = $("#signature");
     
                     var Xrm = window.parent.Xrm;
                     var sigBase64Attribute = Xrm.Page.getAttribute("new_esig_data");  //replace this with your hidden "multiple lines of text" field with a max length of 1,048,576
                     var sigBase64Value = sigBase64Attribute.getValue();
     
                     sig.bind("change", function (e) {
                         sigBase64Attribute.setValue(sig.jSignature("getData"));
                     });
     
                    
                     if (sigBase64Value != null) {
                         sigImage.css("display", "inline");
                         sigImage.attr("src", sigBase64Value);
                     } else {
                         sigPanel.css("display", "inline");
                         sig.jSignature();
                         $("#clear").click(function() {
                             sig.jSignature("clear");
                         });
                     }
                 });
             </script>

    </body></html>

    this is not working at all inside CRM, all I can see is a blank area inside the Web resource field on the entity form. I am by no stretch of the imagination a js or CRM developer so any assistance would be greatly appreciated.

    Saturday, November 22, 2014 4:19 PM

Answers

  • We finally managed to resolve this, it was due to our "new_esig_data" field being in the forms footer rather than the same section. it now works like a charm.
    Sunday, November 23, 2014 5:15 PM

All replies

  • We finally managed to resolve this, it was due to our "new_esig_data" field being in the forms footer rather than the same section. it now works like a charm.
    Sunday, November 23, 2014 5:15 PM
  • Hello,

    I tried to use the same script in CRM online 2016 but I had some problems.

    Can you please, give some details for the steps I must follow?

    I tired to create this field in Users.

    Thanks a lot.

    Monday, April 11, 2016 1:36 AM