Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to generate word document with dynamic content via plugin?

Posted on by 580

Im trying to create CRM plugin which will open Word template, fill it with data. How I can map the dynamic content fields inside plugin ? 

*This post is locked for comments

  • MS CRM DYNAMICS Profile Picture
    MS CRM DYNAMICS 580 on at
    RE: How to generate word document with dynamic content via plugin?

    Yes Dharanidharan, I did and I am able to create but after that I need to pass the file to azure blob? how I can pass to Azure from OOTB workflow?

  • Dharanidharan Profile Picture
    Dharanidharan 390 User Group Leader on at
    RE: How to generate word document with dynamic content via plugin?

    Did you get a chance to go through my above link. It's not through custom workflow its through OOB workflow. Please check it out.

  • MS CRM DYNAMICS Profile Picture
    MS CRM DYNAMICS 580 on at
    RE: How to generate word document with dynamic content via plugin?

    Hi Jandost,

    I have tried creating the document in custom workflow which I can pass to Azure blob but seems like this is not possible. (tried in Plugin as well). Below error while tried in plugin and custom work flow. I am  able to create in workflow or action only, but how I can pass the same document to azure. Any suggestion?

    "The request SetWordTemplate cannot be invoked from the Sandbox "

  • Suggested answer
    Dharanidharan Profile Picture
    Dharanidharan 390 User Group Leader on at
    RE: How to generate word document with dynamic content via plugin?

    You can use the workflow to generate the word document with the Dynamic content.Below is the URL for your reference.

    https://community.dynamics.com/crm/b/nakedcrm/posts/how-cool-creating-word-documents-using-a-workflow

  • Suggested answer
    JandostKhoso Profile Picture
    JandostKhoso 266 on at
    RE: How to generate word document with dynamic content via plugin?

    Hello Bhabani,

    Yes, you can easily write a code in your workflow to push the generated document to Azure. Another alternative is to explore using Flow. That will make it much easier.

    I believe Microsoft is planning to release a functionality to push attachments to Azure but I am not sure about the timelines. However, at the moment you can write a code to push generated document to Azure. Till then I suggest to use Flow.

    What is the trigger for the download the file? Please note that even in the plugin you cannot download the file. I think you still need to upload the file somewhere and then download it.

  • MS CRM DYNAMICS Profile Picture
    MS CRM DYNAMICS 580 on at
    RE: How to generate word document with dynamic content via plugin?

    Hi Jandost,

    Suppose I have created the document in workflow , can I able to do below points with workflow. ( I dint want to attach to notes section)

    1. I need to pass the document to azure blob

    2. Download the document

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: How to generate word document with dynamic content via plugin?

    Take a look at this thred: community.dynamics.com/.../c-replace-email-template

    Hope this helps.

  • Suggested answer
    JandostKhoso Profile Picture
    JandostKhoso 266 on at
    RE: How to generate word document with dynamic content via plugin?

    Since the word document is going to be filled with your data from entities, I would recommend to fill the entity fields in your plugin rather than generating the word document. Once the entity fields are filled, you can fire a workflow in which you can generate your word document. I would not go with generating a file in my plugin.

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.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans