For admins and template authors: build a Generate Quote button on the Salesforce Quote object that creates a PDF quote with numbered line items, currency totals and an expiration date, and saves it to the quote's Files. It takes about 20 minutes with the sample template on this page.
What you'll build
For a sample quote on the Burlington Textiles Weaving Plant Generator opportunity, generated on November 20, 2026, the quote reads:
QUOTE 00000012 · Burlington Textiles generator quote Date: 11/20/2026 · Valid until: 12/31/2026 Prepared for: Jack Rogers, Burlington Textiles Corp of America, 525 S. Lexington Ave, Burlington, NC 27215
| # | Product | Qty | Unit price | Line total |
|---|---|---|---|---|
| 1 | GenWatt Diesel 1000kW | 1 | $10,000.00 | $10,000.00 |
| 2 | SLA: Bronze | 2 | $1,000.00 | $2,000.00 |
| Subtotal | $12,000.00 |
| Total | $12,000.00 |
Below the totals are the terms (This quote is valid until 12/31/2026) and an acceptance block for the customer to sign. The footer reads Page 1 of 1, and the file is saved as Quote 00000012.pdf.
It uses these features:
- TableStart and TableEnd to repeat a row for each quote line item
- RowNumber to number the lines
- CurrencyCulture for prices and totals
- Today and Date format for the quote date and expiration date
- IF conditions for a discount line
- PAGE and NUMPAGES in the footer
- Convert to PDF?, Filename (ofn) and bgm=1 to save a named PDF
Before you begin
- Docs Made Easy is installed and you have a license and the permission set. See Assign licenses and permission sets.
- You can open Document Setup and edit the Quote page layout.
- Quotes are turned on in your org. In Salesforce Setup, search for
Quote Settingsand turn on Enable Quotes. - You have a quote with line items to test with. In Salesforce, you create a quote from an opportunity's Quotes related list, and it copies the opportunity's products. Fill in the quote's Expiration Date, Contact and Account.
This recipe uses only standard Quote fields (Quote Number, Expiration Date, Subtotal, Grand Total, Discount), so you don't need to create custom fields. If you use your own quote ID field instead, such as {{Quote.Quote_Id__c}}, copy its tag from the Merge Field Helper.
1. Build the template
Download the sample template (.docx), ready to upload, or create a Word document with the content below. Replace anything in [square brackets] with your own details.
QUOTE {{Quote.QuoteNumber}}
{{Quote.Name}}
Date: {{Today \@ MM/dd/yyyy}}
Valid until: {{Quote.ExpirationDate \@ "MM/dd/yyyy"}}
Prepared for:
{{Quote.Contact.Name}}
{{Quote.Account.Name}}
{{Quote.Account.BillingStreet}}
{{Quote.Account.BillingCity}}, {{Quote.Account.BillingState}} {{Quote.Account.BillingPostalCode}}
[Word table: 5 columns, 2 rows. Row 1 is the header. Row 2 repeats once per quote line item.]
| # | Product | Qty | Unit price | Line total |
| {{TableStart:Quote.r.QuoteLineItems}}{{RowNumber}} | {{Product2.Name}} | {{Quantity}} | {{UnitPrice \# CurrencyCulture1}} | {{TotalPrice \# CurrencyCulture1}}{{TableEnd:Quote.r.QuoteLineItems}} |
[Word table: 2 columns, 2 rows, aligned right, no borders.]
| Subtotal | {{Quote.Subtotal \# CurrencyCulture1}} |
| Total | {{Quote.GrandTotal \# CurrencyCulture1}} |
{{IF|Quote.Discount|GT|0}}
Your prices include a negotiated discount.
{{ELSE}}
Prices are list prices.
{{ENDIF}}
Terms and conditions
1. This quote is valid until {{Quote.ExpirationDate \@ "MM/dd/yyyy"}}.
2. You will be invoiced when you accept this quote.
3. Prices exclude applicable taxes.
Customer acceptance
Name: ______________________ Signature: ______________________ Date: __________
[Footer]
Page {{PAGE}} of {{NUMPAGES}}
To turn this into a Word template:
- Paste the text into a new Word document. Replace each
[Word table …]block with a real Word table that has the same rows and cells, and put the[Footer]line in the page footer. - Keep each tag exactly as written, in one piece.
TableStartgoes in the first cell andTableEndin the last cell of the same row, so that row repeats for each line item. - Replace the terms with your own. When you upload the template in step 2, open the Merge Field Helper and copy any field whose name differs in your org. See Where to get merge fields.
The IF block checks the quote's Discount. Every {{IF}} needs its {{ENDIF}}.
{{Product2.Name}} in the line-item row merges the product's name through the line item's product lookup. Insert Related List > QuoteLineItems also offers Product2Id, but that merges the product's record ID.
2. Create the solution
- In Docs Made Easy, open Document Setup and click Launch Wizard.
- On Add Details, enter
Generate Quoteas the Button Name, select Quote and click Create. The Gather Data page opens. - Click Next. The line-item table reads the quote's line items through the
Quote.r.QuoteLineItemsrelationship in the template, so you don't add anything here. - Click Add templates and choose Upload a document (before v1.25: Create New Document Template). To check the line-item tags, click Merge Field Helper > Insert Related List and select QuoteLineItems. The helper generates
{{TableStart:Quote.r.QuoteLineItems}}and{{TableEnd:Quote.r.QuoteLineItems}}. - Enter
Quoteas the Template Name, upload your Word file and click Save. Click Next. The Assign Behaviors page opens.
Each wizard screen is described in Create a template with the Document Automation Wizard.
3. Set the behaviors
On the Assign Behaviors page, set the following. Click Save in each section, then click Next.
| Section | Setting | Value | Why |
|---|---|---|---|
| Generated File | Convert to PDF? | On | Customers get a quote they can't edit. |
| Generated File | Filename | Quote {!Quote.QuoteNumber} | Each file is named after its quote number, so it's easy to find. |
| Background Mode | Would you like to enable background mode? | On, with File (bgm=1) | One click saves the PDF to the quote's Files and downloads a copy. |
| Other Parameter | CurrencyCulture1 | en-US | Formats prices and totals as US dollars with separators and two decimals, for example $10,000.00. Use the culture code for your currency. |
The file name keeps its space, and .pdf is added automatically, so the file is saved as Quote 00000012.pdf.
4. Add the button
- On the last wizard page, click Go to Page Layouts and open Quote Layout.
- From Mobile & Lightning Actions, drag Generate Quote into Salesforce Mobile and Lightning Experience Actions.
- Click Save.
If users don't see the button, see Users can't see or use the button.
5. Generate and check
Open a quote with line items and click Generate Quote. Background mode skips the Composer page, and the PDF downloads.

Check the quote against the record:
- The quote number and name match the record.
- Valid until shows the quote's Expiration Date. If it's blank, the field is empty on the quote.
- There is one numbered row per line item, with the product, quantity and prices.
- Subtotal and Total match the quote's Subtotal and Grand Total.
- The discount sentence matches the quote's Discount.
On the quote's Related tab, open Files.
Quote 00000012.pdf(with your quote number) is listed.
Troubleshooting
| What you see | Fix |
|---|---|
A tag such as {{Quote.Contact.Name}} shows as text, or a value is blank | The API name is wrong, the field is empty or you can't see it. Copy the tag from the Merge Field Helper. See Merge fields are blank or show as text and DME-SF-002. |
| The line-item table is empty or has only one row | Put TableStart and TableEnd in the same row with Quote.r.QuoteLineItems in both, and check that the quote has line items. See Tables are empty, show one row or repeat. |
The product column shows an ID such as 01t… | The cell uses {{Product2Id}}, which is the product's record ID. Use a name field instead. |
| Prices have no currency symbol, or dates are in the wrong format | Add CurrencyCulture1 as an Other Parameter and \# CurrencyCulture1 to each amount tag; check the date pattern's letter case. See Wrong date, number or currency format. |
| The PDF layout differs from the Word file | Fonts or floating objects change in conversion. See The PDF looks different from my Word template. |
Take it further
- Choose where the file goes: save to Notes & Attachments, Chatter or only download. See Where generated documents are saved.
- Email the quote: add an email template to the solution and set recipients under Assign Behaviors > Email. See Create a template with the Document Automation Wizard.
- Get the quote signed (Pro): replace the acceptance block with an eSignature request. Add the signature tags to the template before you upload it, or in the Template Editor. See Generate and send documents for eSignature.
- Create the quote PDF automatically (Pro), for example when a quote's status changes: Automate document generation with Flow.
- Invoice the deal when it closes: Generate an invoice from an opportunity.