20
Until recently, it has been possible to programmatically generate a PDF from a Word Template by either making a request like this OrganizationRequest("ExportPdfDocument"), or calling the exportPdf action. This latter method is publicly documented:
https://docs.microsoft.com/en-us/dynamics365/sales-enterprise/developer/exportpdf-api

Calls to this are now receiving the response: 'The private ExportPdfDocument request cannot be called from this plug-in because it has a different solution publisher.' and Microsoft support say that these methods, although publicly available, are only intended for private use by Microsoft.

These methods were very useful and their withdrawal leave us with no supported way to programmatically generate PDF's from Word templates. Power Automate is an option, but not if customers want real-time generation of PDF's. Other customers require merging of several PDF's - again not possible using Power Automate.
The only other alternative seems to be buying some 3rd party tool to do the conversion.

Please re-instate this functionality and make it 'public' and support it.
Category: General
STATUS DETAILS
New

Comments

B

We raised a MS support ticket when the change blocking ExportPdfDocument from plugins was rolled out in a silent service update. Support told us there were /many/ customers using this and they eventually it was restored after a week. We implemented a workaround calling the web api function from client script.


So ExportPdfDocument works again, but nonspecific documentation updates relating to it will be made sometime in the future.

Hopefully they just set isprivate = false and move on. A friendlier/more powerful API would be nice, but it doesn't make any sense allow call a message to be used only via the webapi and not from plugins.

Category: General

B

Another couple of reasons why the alternative solutions that you could use for this are less than ideal:
1.) Any other solution would rely on the creation of a Word document from a Word Template and the Word document getting saved against a record in CRM. So there are storage issues there - why generate the Word document if it's never going to be used except to generate the PDF. The current solution allows for the creation of a PDF without having to go through the interim Word document, and can be done entirely in memory, so no storage required if the PDF is just going to be printed or emailed.
2.) All other solutions that I've looked at require a Workflow or Flow to fire whenever an annotation is created in CRM. But this means that every note that gets created in CRM will result in a workflow firing, even if the note doesn't even have an attachment, or even if the attachment is not of the type which will get turned into a PDF by the flow. This is massively inefficient, and could result in thousands of flows/workflows firing which are doing nothing useful at all.

Category: General