Documents·Reference·7 min·Updated 2026-10-05
Generating the quote document
A branded PDF from a quote, without building a data-extraction layer to feed it.
Business requirement
Produce the commercial proposal as a document, with the customer, the lines and the totals, in the company's template.
Why it is not trivial
The template needs data in a shape the quote does not natively have, and the obvious answer — build an extraction layer — creates a second model to maintain alongside the first.
Recommended architecture
Bind the template to the context definition the pricing engine already uses. See document generation on the pricing context.
Salesforce components
Select one to open its detail.
Flow
Scroll the diagram sideways
The context service is the integration surface that matters: pricing, tax and document generation all read the same definition, so extending it once serves all three. Document generation in particular reuses the pricing context — which removes an entire data-extraction layer that older approaches needed.
Implementation
Tokens are attribute names. Custom attributes must be mapped, tagged and published before they resolve — until then only the inherited attributes render, which is the symptom that sends people looking in the wrong place.
Watch out
- Choose the total that means net. The headline total can be the sum of list prices and will overstate the document.
- Dates render as raw ISO timestamps unless formatted upstream.
- The context exposes an account reference, not the account name — resolve it before the template.
- Replacing the template file can change its identifier and break any button holding it. Upload a new version of the same file instead.
Alternatives
An external document service is the answer at high volume or where the document needs assets Salesforce should not store. For a quote PDF, it is a dependency bought for nothing.
Guide