CRM 2013 C# Plugin fill Word template

1.1k views Asked by At

Im trying to create CRM plugin which will open Word template, fill it with data and download it to the user. This all work fine, except when I need to download document to the user. I know its not possible download it throught HttpResponse, so I dont know how I will tackle this.

Do you have any suggestion??

NOTE: here Dynamic CRM Plugin download Word document is the similar problem, which didnt solve the problem ,just sayed that is not possible throught HttpRequest.Response.

2

There are 2 answers

0
Alex On BEST ANSWER

The only means for plugins to "communicate" with users is an Exception (obviously, we don't want that!), my preferred approach in these cases is to create an annotation (a Note) attached to the record which triggered the plugin, attaching the file to it.

You'd then be able to download the file via JS through OData/FetchXml.

4
Filburt On

I don't know how far you already mastered creating your word document from a template, but I think the best way to achieve this would be to have a report create it for you.

With creating the doc out of the way, you can now simply open the Report from a custom Ribbon Button as described by Jason Lattimer.

If you still have the need to perform any special processing only possible in your Plugin before returing the doc, you could replace the standard "Save" Button by your custom Button.

Crm 2011 is limiting your options - if you'd be on Crm 2013 or 2015 things would be a lot easier.