Templates preview and audit trail

What this app is

The preview app renders a completed document in read-only form. It has two jobs:

  1. It is the page the PDF rendering service converts to PDF, so the stored PDF matches the on-screen document exactly.
  2. It is a clean, non-interactive view of a finished document that can be embedded on a Lightning record page as a preview of what was produced.

It is hosted on the GeneratedDocument page.

URL parameters

Parameter Purpose Required Values
id The tracking record whose completed document to display. Yes Document Trace (single user) or Redline Request (collaboration)

There are no template, record, preview, or collaborator parameters here. Everything is resolved from the tracking record.

How it renders

  1. The tracking record determines the mode: single user or collaboration.
  2. In collaboration mode, all signers on the request are loaded in order so the audit trail can list each one.
  3. The already-generated document body (Document.html) is fetched from the record and displayed with no editable controls and no submission form.
  4. The document's styles are applied to the page so the PDF matches the on-screen document.

If the completed document file does not exist yet, the preview reports that the document is not ready.

Audit trail

When the template has Show Audit Trail enabled and the document is signed, the preview appends a signature and audit page. For each signer it shows:

In single-user mode this is the one signer from the Document Trace. In collaboration mode it is every collaborator on the request, in order. This audit page is included in the captured PDF, so the finished document carries its own proof-of-signing record.

Embedding as a record-page preview

Because the app is read-only and self-contained, it is commonly embedded on the Lightning record page of the generating record so users can see the finished document inline without downloading it.

Headers and footers

The preview shows a completed Template's stored header and footer above and below the document. Printed output repeats them on every page, including audit trail pages, and uses the first-page variants when configured. These values come from the completed document rather than current Salesforce merge data. See Headers and footers.