Notifications
Announcements
No record found.
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
Hi!
There is a action that you can use - see community.dynamics.com/.../how-cool-creating-word-documents-using-a-workflow
Hope this helps
Refer this:
community.dynamics.com/.../crm-tip-automatically-creating-document-from-word-template-and-attaching-to-record
www.powerobjects.com/.../how-to-create-a-microsoft-word-template-in-microsoft-dynamics-365
I want quote info and its lines based on some condition, but out of the box not working as the i am not able to put any kind of filter there. and thats why i want to create it from plugin with my own query.
I already know thin and used in couple of times. But I want quote info and its line based on some condition, but out of the box not working as the i am not able to put any kind of filter there. and thats why i want to create it from plugin with my own query.
Hi Vijay,
Use SetWordTemplate OrganizationRequest
OrganizationRequest req =
new
OrganizationRequest(
"SetWordTemplate"
);
req[
"Target"
] =
EntityReference(
"account"
, accountGuid);
"SelectedTemplate"
"documenttemplate"
, templateGuid);
service.ExecuteCrmOrganizationRequest(req);
Check this out:
https://crmtipoftheday.com/608/generate-documents-in-code/
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?
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
docs.microsoft.com/.../manage-word-templates
Refer above on creating word templates.
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.
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-fetchxmlIt will be more coding than using word template, but you don't have the above-mentioned restriction on datasource.
Regards,
Abby
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2