Back to Blog
·VerseBlocks

How to Generate a PDF from a Dataverse Record Without Leaving Your Tenant

VerseDocsDataversePower AutomateDocument Generation

Someone opens an Opportunity and wants a quote as a PDF. That sentence has been the start of more consulting hours than almost anything else in Dynamics, because the platform gives you four ways to do it and none of them is obviously right.

Here is what each one does, where it breaks, and what it costs. Then the walkthrough for the one that keeps your records in your tenant.

The four options

Built-in Word templates. Free, included, and fine for a one-page letter. They stop working the moment a template needs a repeating table row with an image in it, a section that only appears when a field has a value, or more than 100 related records per relationship. They cannot be triggered from a flow, they cannot be moved between environments, and PDF output exists only for a handful of Sales Hub tables. Everywhere else you get a Word file, and then someone opens it and prints to PDF by hand.

Populate a Microsoft Word template in Power Automate. This is the Word Online (Business) connector. It is premium, so every user or flow that runs it needs a Power Automate Premium licence. The template has to live in SharePoint or OneDrive, not Dataverse. Input files are capped at 10 MB, several content-control types are unsupported, images cannot go in headers, and the PDF step is a second action against OneDrive. It works, and a great many production flows are built on it. It is also a three-hop round trip for every document: Dataverse to Word Online to OneDrive to wherever the file ends up. We wrote up the full list of limits separately.

A third-party document connector. Encodian, Plumsail, Nutrient, Resco and others. These are capable products and they handle loops, conditionals and PDF properly. Two things to know before you commit. First, they render your document in their cloud: the record data and the template leave your tenant, get merged on their infrastructure, and come back. Second, they meter. Credits, documents or operations per month, and the month's allowance runs out at exactly the moment a quarter-end invoice batch runs. We put the public prices side by side with links to each vendor's page.

A plug-in that runs inside Dataverse. The document engine is installed into your environment as a managed solution and runs in the Dataverse plug-in sandbox, the same place your own C# plug-ins run. The record never leaves. There is no connector to license, no Azure resource, no app registration. This is how VerseDocs works, and the rest of this post is the walkthrough.

The walkthrough: record to PDF in one action

VerseDocs ships as a managed solution. Install it from AppSource or import the zip from the downloads page. Everything works immediately; until you add a licence key the output carries a trial watermark, and nothing expires.

1. Build the template in Word

Open Word. Lay out the quote exactly as you want it printed, with your letterhead, fonts and table styling. Where a value goes, type a token:

Quote for {{quote.name}}
Prepared {{quote.createdon}}
Valid until {{quote.effectiveto:d MMMM yyyy}}

Values arrive already formatted the way Dataverse shows them, so a lookup renders as the account name, a money column as $1,800.00 and an option set as its label. Add :format when you want your own formatting, as on the date above.

For line items, put a single row in a table and wrap it in a loop. The related rows come from the template's own binding, under whatever alias you gave them:

{{#each quote.lines}}
{{productdescription}}  |  {{quantity}}  |  {{extendedamount}}
{{/each}}

Total: {{sum:quote.lines.extendedamount:N2}}

Totals are computed in the template, so nothing has to be pre-summed onto the record. Conditionals with {{#if}}, nested loops, images and the rest are in the template syntax reference. Tokens survive Word splitting them across runs, which is the thing that quietly breaks most home-grown OpenXML generators. If you would rather not start from a blank page, Template Studio in the admin app has starters, and you can author and validate there instead of in Word.

2. Bind it to the table

In the VerseDocs Admin app, upload the template and bind it to the Quote table. Validate walks every token and tells you which ones do not resolve against a real column or relationship before anyone generates anything.

3a. Generate from the record

Tick Quote in Administration → Configuration and a Generate document button appears on the Quote form, for the users you choose. Pick the template, pick PDF, and the file lands on the record's timeline as a note with the attachment. No flow, no extra licence, no code.

3b. Or generate from a flow

Any trigger you like. Then one action: Microsoft Dataverse → Perform an unbound action.

One thing catches everyone: searching the action picker for "VerseDocs" finds nothing, because Dataverse lists custom APIs by their schema prefix. Search for vdocs and all 69 appear. Pick vdocs_TemplateFromRow, give it the template id, the row id, and an output format of pdf in the options.

The file comes back as base64 in OutFileContent. Wrap it in base64ToBinary() and hand it to any file action you already use: SharePoint Create file, Outlook Send an email with attachment, OneDrive, or Dataverse Add note. If all you want is the PDF attached to the record's timeline, vdocs_GenerateAndAttach does the generate-and-attach in one call.

That is the whole flow. Two steps on the canvas.

What just happened to your data

The template bytes, the row's field values, the child records and the rendered PDF were read and produced in memory inside the plug-in sandbox in your environment, in your region. Nothing was written anywhere and no outbound call carried any of it. If your legal team asks where the quote went to be built, the answer is: nowhere.

The button and the flow call the same engine, so the output is byte-identical whichever path produced it, and there is one implementation to maintain.

What it costs

Nothing to try, for as long as you like. One flat licence of $2,400 a year covers every environment and user in the tenant, with no document count. The pricing page has the details and the in-product buy flow. If you want to see the arithmetic against what a metered connector costs at your volume, the cost calculator does it.

Get VerseDocs on AppSource and generate your first PDF this afternoon.