Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full On-Demand Document entry
How-to guide

How to set up on-demand document generation for a quote

The most common on-demand document use case is a CPQ quote PDF. Set it up by building a template in the CPQ Document Designer, mapping merge fields to Quote data, and adding the Generate Document button to the page layout.

By Dipojjal Chakrabarti · Founder & Editor, Salesforce DictionaryLast updated May 21, 2026

The most common on-demand document use case is a CPQ quote PDF. Set it up by building a template in the CPQ Document Designer, mapping merge fields to Quote data, and adding the Generate Document button to the page layout.

  1. Build the template in Document Designer

    Setup > Document Designer > New Template. Drag content blocks (text, tables, images, page break) onto the canvas. Insert merge fields by typing the field API name in curly braces. Add conditional sections for clauses that should appear only when criteria are met.

  2. Test against a sample quote

    From the Document Designer, click Preview. Pick a real Quote in the sandbox. Verify the merged values look right and conditional sections fire as expected. Iterate the template until the output is correct.

  3. Add the Generate Document button to the Quote layout

    Object Manager > Quote > Page Layouts. Drag the Generate Document button into the Salesforce Mobile and Lightning Experience Actions section. Save the layout.

  4. Wire up storage and naming convention

    Decide where generated documents go (ContentDocument on Quote, an external library, a synced folder). Configure the file naming convention to include Quote Name, Date, and Version so files do not collide.

  5. Test end to end

    Open a Quote, click Generate Document, confirm the PDF matches expectations, save it to the Quote, regenerate to verify the version increments correctly.

Key options
Salesforce CPQ Document Designerremember

Native, no extra license. Best for quotes and proposals in a CPQ-licensed org.

OmniStudio Document Template Sourceremember

Best for Industries cloud workflows. Triggered from OmniScripts and Integration Procedures.

Visualforce PDFremember

Free, code-based. Good for legacy or highly customized PDFs that simple templates cannot produce.

Conga Composerremember

Premium AppExchange. Rich template language, e-signature, batch generation. Best for complex enterprise use cases.

S-Docs / Nintex DocGenremember

Competing AppExchange tools. Pick based on existing vendor relationships and feature set.

Gotchas
  • Generated documents count toward file storage limits. A busy CPQ org generating thousands of quote PDFs per month can exhaust org storage; offload to external archive or set a retention policy.
  • Document Designer templates do not support every Salesforce field type cleanly. Multi-select picklists, rich text fields, and encrypted fields may merge as raw values or fail to render. Test edge cases.
  • Conga and other third-party engines have their own callout limits and API quotas. Batch generation can hit those before the underlying Salesforce limits; monitor vendor dashboards in parallel.
  • E-signature workflows tied to generated documents (DocuSign, Adobe Sign) require the generated file to be stored, not just rendered transiently. Save to Quote (or equivalent) before sending for signature, or the signed copy will not link back to the source record.

See the full On-Demand Document entry

On-Demand Document includes the definition, worked example, deep dive, related terms, and a quiz.