Hi Experts,
Can we create word document from plugin for MSD 365? is it possible? If so how? Done anyone have sample code?
Thanks.
*This post is locked for comments
No worries Vijay. Hope you find a way to solve the problem.
Hi Abby,
Thanks for kind help, probably i will go with some work around for this. Thanks again.
Hi Vijay,
I understand your pain in implementing custom logic with the restrictions of word document template.
Again, I think a custom Fetch-based SSRS report would suit you better in this case as it's much more flexible and you can also generate word document from it.
Maybe someone else can shed more light on this.
Regards,
Abby
Hi Abby,
I know we cannot apply filter on it, that's why i am trying to do it from plugin with my own query.
Thanks.
I think there are ways to read the word document from note and programmatically change the content and save it. I'm not an expert on this and I highly suggest NOT to do it. It's more work and maintenance going forward, in my opinion.
Hi Vijay,
As far as I know, we can't apply filter/sorting on the data source use word document template.
Not sure on the exact requirement, or the number of possible document outputs. If your template is different based on some condition, maybe you can create multiple templates and implement the logic to decide which one to run in the code.
Alternatively, if you are triggering doc-creating in code, consider the option to create a custom Fetch-based report.
This is a good guide: community.dynamics.com/.../ssrs-reports-for-dynamics-365-using-fetchxml
It will be more coding than using word template, but you don't have the above-mentioned restriction on datasource.
Regards,
Abby
Hi Abby,
Thanks for quick responses. See, i am able to create and attach it in notes area of the entity but problem is now i want to add my custom data table in the same Document, is it possible?
In word template i kept all the required details of the quote, its fine but now i want to fire a query in plugin and I will create a my data table and want to put that in the newly created document. I hope you got my query now. Let me now if you need any other info.
Thanks.
docs.microsoft.com/.../manage-word-templates
Refer above on creating word templates.
hmmm, can you elaborate on 'change/append the content of the document'??
The word template should be set up as a system template before you use this code.
Use the template id from this system template.
Replace 'new EntityReference("account", accountGuid)' if your entity is not account.
The generated word document is same as the ones generated from UI ->Ribbon Buttons-> Word Template
Thanks Abby, but will it allow me to change/append the content of the document? Or do i need to replace by some kind of trick?
Thanks.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156