1
votes

We've been implementing a Dynamics CRM 2011 solution where one of the requirements was to print out a bespoke-styled form containing sub-grids and charts. The short story is that clicking on a "print" link (which calls the window.print() method) throws up a series of JavaScript errors. These, however, are non-fatal and clicking through each will allow the form to be printed OK.

Line: 73
Char: 24234
Error: The value of the property 'isNull' is null or undefined, not a Function object.
URL: https:://aks7.crm4.dynamics.com/_static/_forms/controls/img.lu.htc?ver=-115872263

(note that the double colon above was intentional!)

One of our early thoughts was that the problem was down to unsupported customisations, so as a test I created a new entity with a basic form. On the ribbon I added a print button which calls the window.print() method. The result is exactly the same. I've also replicated the issue on CRM Online.

The upshot is that either using window.print() is unsupported, or we've found a bug or both. Is there a solution to this?

2

2 Answers

0
votes

I suspect that it's unsupported since the native print functionality renders a different page before sending to print (suggesting that this is a workaround for some feature of their .htc files).

Can you not take the same approach? The stub URL for the "Print Preview" is at .../_forms/print/print.aspx?allsubgridspages=true&formid=<form-guid>&id=%7b<record-guid>%7d&objectType=<object-type-code>. You could wrap this is a HTML web resource and call the CRM print button function from your HTML holding frame.

0
votes

Instead of using the window.print, you have to automate the print preview.

I use this, but it's unsupported:

parent.document.getElementById('Mscrm.Jewel-Default').children[0].click();
parent.document.getElementById('Mscrm.Jewel.PrintPreview-Menu16').click();

http://blog.customereffective.com/blog/2011/08/printing-in-crm-2011.html