For admins and template authors: build a Generate SOW button on Opportunity that produces a PDF scope of work with the client's details, the project dates, a numbered table of deliverables (the opportunity's products) with fees and a total, and a sign-off block. The PDF is saved to the opportunity's Files. It takes about 25 minutes with the sample template.
What you'll build
For the sample opportunity Annual Support & Maintenance Contract with Burlington Textiles Corp of America, the SOW reads like this:
SCOPE OF WORK · Annual Support & Maintenance Contract Prepared for Burlington Textiles Corp of America on November 20, 2026
Client: Burlington Textiles Corp of America · Apparel · (336) 222-7000 · 525 S. Lexington Ave, Burlington, NC 27215, United States Project lead: Jordan Smith Timeline: January 5, 2027 to March 31, 2027
4. Deliverables and fees
# Deliverable Description Qty Fee 1 Discovery Workshop Stakeholder workshops and process mapping 1 $4,000.00 2 Configuration Services Salesforce configuration per approved design 10 $12,000.00 3 Training Session End-user training 2 $3,000.00 Total $19,000.00 Confidential · Burlington Textiles Corp of America · Page 1 of 2 File saved as
SOW - Annual Support & Maintenance Contract - 20-Nov-2026.pdf
The Deliverable column shows each product's name through the line item's product lookup, {{Product2.Name}}.
It uses these features:
- Merge fields from the opportunity, its account and its owner
- Today's date and Date format (
\@) - TableStart and TableEnd to repeat a row per product, with RowNumber and TableHide
- CurrencyCulture and AUTOSUM(ABOVE) for fees and the total
- PAGE and NUMPAGES in the footer
- Default PDF, Output file name (ofn) and bgm=1
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 create fields and edit the Opportunity page layout.
- You have a test opportunity with an account and a Description, and products whose Line Description describes each deliverable.
- Create two custom fields for the project dates:
- In Setup, open Object Manager > Opportunity > Fields & Relationships and click New.
- Choose Date, click Next, and enter
Project start dateas the Field Label. Salesforce sets the API name toProject_start_date__c. - Make the field visible to the profiles that generate SOWs, add it to the Opportunity layout, and click Save.
- Repeat for
Project end date(Project_end_date__c).
Everything in this recipe, including CurrencyCulture, AUTOSUM(ABOVE), Convert to PDF? and background mode (bgm=1), works in both Basic and Pro. Only sending the SOW for eSignature (in Take it further) needs Pro.
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.
[HEADER, right-aligned]
Scope of Work · {{Opportunity.Name}}
[BODY]
SCOPE OF WORK
{{Opportunity.Name}}
Prepared for {{Opportunity.Account.Name}} on {{Today \@ MMMM d, yyyy}}
1. Parties to this agreement
CLIENT
Company: {{Opportunity.Account.Name}}
Industry: {{Opportunity.Account.Industry}}
Website: {{Opportunity.Account.Website}}
Phone: {{Opportunity.Account.Phone}}
Address: {{Opportunity.Account.BillingStreet}}
{{Opportunity.Account.BillingCity}}, {{Opportunity.Account.BillingState}} {{Opportunity.Account.BillingPostalCode}}
{{Opportunity.Account.BillingCountry}}
SERVICE PROVIDER
Company: [Your company name]
Project lead: {{Opportunity.Owner.Name}}
Email: {{Opportunity.Owner.Email}}
2. Project overview
{{Opportunity.Description}}
3. Timeline
Project start: {{Opportunity.Project_start_date__c \@ "MMMM d, yyyy"}}
Project end: {{Opportunity.Project_end_date__c \@ "MMMM d, yyyy"}}
4. Deliverables and fees
[TABLE: 5 columns. Row 1 is the header; its first cell starts with the TableHide tag, so the whole table is left out when the opportunity has no products. Row 2 repeats once per product. Row 3 totals the Fee column.]
| {{TableHide:Opportunity.r.OpportunityLineItems}}# | Deliverable | Description | Qty | Fee |
| {{TableStart:Opportunity.r.OpportunityLineItems}}{{RowNumber}} | {{Product2.Name}} | {{Description}} | {{Quantity}} | {{TotalPrice \# CurrencyCulture1}}{{TableEnd:Opportunity.r.OpportunityLineItems}} |
| | | | Total | {{AUTOSUM(ABOVE)\# CurrencyCulture1}} |
[END TABLE]
5. Assumptions
- The Client provides access to its Salesforce org, data and subject-matter experts when needed.
- Work outside the deliverables above is handled as a change request.
6. Change requests
Either party may request a change to the scope in writing. Changes that affect fees or the timeline take effect only when both parties approve them in writing.
7. Acceptance and signatures
CLIENT AUTHORIZATION: {{Opportunity.Account.Name}}
Name: ______________________________
Title: ______________________________
Signature: ______________________________
Date: ______________________________
SERVICE PROVIDER: [Your company name]
Name: {{Opportunity.Owner.Name}}
Signature: ______________________________
Date: ______________________________
[FOOTER, centered]
Confidential · {{Opportunity.Account.Name}} · Page {{PAGE}} of {{NUMPAGES}}
Create a Word document with this content. Lines in square brackets and capitals, such as [HEADER, right-aligned] and [TABLE: …], tell you where the text goes; don't type them. Build the table as a real Word table with 5 columns and 3 rows, one cell per |-separated value. The {{TableHide:Opportunity.r.OpportunityLineItems}} tag goes in the header row's first cell, before the #. When the opportunity has products, the tag is removed from the output and the header shows as normal. Replace the other bracketed text, such as [Your company name], with your own wording. Type each {{…}} tag in one go, without changing its formatting halfway, so Word doesn't split it.
API names in your org can differ, especially for the custom date fields. Check each one in the Merge Field Helper when you upload the template (step 2): pick a field from the Account ID lookup to get the Opportunity.Account.… form.
{{Product2.Name}} in the line-item row merges the product's name through the line item's product lookup. {{Name}} would show the opportunity product's own name, which Salesforce builds from the opportunity name and the product name.
2. Create the solution
- In the Docs Made Easy app, click Document Setup, then click Launch Wizard.
- Enter
Generate SOWas the Button Name, select Opportunity and click Create. The Gather Data page opens. - Click Next. The template reads products through the standard
Opportunity.r.OpportunityLineItemsrelationship, and the account and owner through lookups, so you don't need to add relationships here. - Click Add templates and choose Upload a document (before v1.25: Create New Document Template). Enter
Scope of Workas the Template Name, upload your Word file and click Save. Then click Next.
For a description of every wizard page, see Create a template with the Document Automation Wizard.
3. Set the behaviors
On the Assign Behaviors page, set these, clicking Save in each panel, then click Next:
| Setting | Value | Why |
|---|---|---|
| Generated File > Convert to PDF? | On | SOWs go out as PDF, so the layout can't be edited by accident. See Default PDF. |
| Generated File > Filename | SOW - {!Opportunity.Name} - {{TODAY}} | Each file names the deal and the date it was made, so revisions are easy to tell apart. See Output file name. |
| Background Mode > Would you like to enable background mode? | On, with File (bgm=1) selected | One click saves the PDF to the opportunity's Files and downloads a copy. The Composer page is skipped. See bgm=1. |
Other Parameter > CurrencyCulture1 | en-US | Formats the fees and the total as US dollars, for example $12,000.00. AUTOSUM(ABOVE) needs a currency culture. Use your own culture code. See CurrencyCulture. |
4. Add the button
- On the last wizard page, click Go to Page Layouts and open Opportunity Layout.
- From Mobile & Lightning Actions, drag Generate SOW into Salesforce Mobile and Lightning Experience Actions.
- Click Save.
If users still don't see the button, see Users can't see or use the Docs Made Easy button.
5. Generate and check
- Open your test opportunity and click Generate SOW. The PDF downloads.
- Check the PDF against the opportunity:
- The client details match the account, and the project lead is the opportunity owner.
- The project dates match Project start date and Project end date, written like January 5, 2027.
- The deliverables table has one numbered row per product.
- Fees show a currency symbol, thousands separators and 2 decimals.
- The Total equals the opportunity Amount (when the amount comes from its products).
- The footer shows the right page count, for example Page 1 of 2.
- On the opportunity's Related tab, open Files. The SOW PDF is listed.
Your SOW looks similar to this, with your own styling:

Troubleshooting
| What you see | Fix |
|---|---|
{{Opportunity.Project_start_date__c}} appears as text, or a value is blank | The API name is wrong, the field is empty on the record, or you can't see the field. Copy the syntax from the Merge Field Helper and check field-level security. See Merge fields are blank or show as {{…}} text. |
| The deliverables table is missing, shows one row or repeats wrongly | If the opportunity has no products, TableHide leaves the table out. Otherwise, TableStart and TableEnd must be in the first and last cell of the same row. See Related-list tables are empty, show one row or repeat. |
| Fees or the total show as 12000 with no symbol, or dates as 2027-01-05 | CurrencyCulture1 isn't saved on the solution, or the \# or \@ switch is missing from the tag. See Dates, numbers or currency show the wrong value or format. |
| The PDF's table, fonts or page numbers differ from Word | See The PDF looks different from my Word template. |
Take it further
- Save without downloading: add
SkipDownload1as an Other Parameter, andredirecttourl/{!Opportunity.Id}to return the user to the opportunity. See Where generated documents are saved for the other save locations. - Get the SOW signed (Pro): send it for eSignature with Sign Made Easy. Add signature tags to the template before you upload it, or in the Template Editor; they aren't in the Merge Field Helper. See Generate and send documents for eSignature.
- Email the SOW: add an email template to the solution, or send the PDF in background mode without a preview with
directemailsenderand a Docs Made Easy email template. - Generate it automatically (Pro), for example when an opportunity reaches a set stage: Automate document generation with Flow.
- Quote the same products: Generate a quote.