Generate PDF Attachments in Dynamics 365 Using Microsoft Flow

Image for post
Image for post

When we need to generate a PDF in Microsoft Dynamics 365, for example, a quote or invoice, we generally have two choices:

1. Either, automate it using a third-party add-on
2. Or, manually convert to PDF using a word template

But, we have another easy solution that helps us to generate PDF attachments. Microsoft Flow helps us to get the work done without coding by following the below steps.

1. Add an on-demand workflow that runs on a quote and generates a word document.
2. Develop a flow that fires of the creation of a note record and does the PDF conversion and attaches the note record back against the original record.

I will explain these using an example, say a quote and a quote summary.

On-demand workflow to generate a word document

Using the standard out of the box functionality, add an on-demand workflow. Dynamics 365 also has an out of the box action which we can make use of. Here we use the action ‘SetWordTemplate’

Image for post
Image for post

We have to add the action ‘SetWordTemplate’

Image for post
Image for post

In properties, select the template.

Image for post
Image for post

This workflow will be available on demand and when we run this, a docx quote summary will be generated as an attachment in the quote.

Create a Flow for PDF conversions

We have to create a flow that is triggered by the creation of a note record. We also have to check if the regarding is quote and has document attachment. The whole steps to create a flow is given below.

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Conclusion

Though there are a lot of out-of-the-box functionalities in Dynamics 365 that benefit our requirements, some functionalities like saving/converting a word document to PDF manually remains outside the box. Microsoft Flow comes as an ideal solution in this context.

Originally published at www.bridge-global.com.

We Are A Self-Organized Squad of IT Experts

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store