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

#ProductQtyUnit priceLine total
1GenWatt Diesel 1000kW1$10,000.00$10,000.00
2SLA: Bronze2$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:

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 Settings and 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:

  1. 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.
  2. Keep each tag exactly as written, in one piece. TableStart goes in the first cell and TableEnd in the last cell of the same row, so that row repeats for each line item.
  3. 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

  1. In Docs Made Easy, open Document Setup and click Launch Wizard.
  2. On Add Details, enter Generate Quote as the Button Name, select Quote and click Create. The Gather Data page opens.
  3. Click Next. The line-item table reads the quote's line items through the Quote.r.QuoteLineItems relationship in the template, so you don't add anything here.
  4. 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}}.
  5. Enter Quote as 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.

SectionSettingValueWhy
Generated FileConvert to PDF?OnCustomers get a quote they can't edit.
Generated FileFilenameQuote {!Quote.QuoteNumber}Each file is named after its quote number, so it's easy to find.
Background ModeWould 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 ParameterCurrencyCulture1en-USFormats 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

  1. On the last wizard page, click Go to Page Layouts and open Quote Layout.
  2. From Mobile & Lightning Actions, drag Generate Quote into Salesforce Mobile and Lightning Experience Actions.
  3. Click Save.

If users don't see the button, see Users can't see or use the button.

5. Generate and check

  1. Open a quote with line items and click Generate Quote. Background mode skips the Composer page, and the PDF downloads.

    Generate Quote button on the Quote record

  2. 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.
  3. On the quote's Related tab, open Files. Quote 00000012.pdf (with your quote number) is listed.

Troubleshooting

What you seeFix
A tag such as {{Quote.Contact.Name}} shows as text, or a value is blankThe 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 rowPut 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 formatAdd 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 fileFonts or floating objects change in conversion. See The PDF looks different from my Word template.

Take it further