Back to the blog

Salesforce document generation: create signed contracts from Opportunity

Document Generation 6 min read 12 October 2026

The problem: contracts are edited by hand and signatures take days

You’re the admin who keeps Opportunity, Quote and Contract records tidy. But the contract process still looks like a copy-paste job: a sales rep downloads a Word file, updates fields manually, emails it, then spends days chasing signatures. That gap is exactly where Salesforce document generation belongs — pull data from Opportunity, Quote, Account, Contact and related line items and produce a finished document in a click.

Why Salesforce document generation fails for admins (and how to avoid it)

Failures usually come from three things: the template is stored outside Salesforce, the merge needs child rows (line items) and the trigger requires a developer. You want clicks, predictable storage, and a reliable signature flow.

Here’s a hypothetical but realistic scenario to keep in mind: you maintain a 60-page Master Services Agreement as a Word template, you process 200 renewals a month, and each unsigned contract costs the team four days of chasing signatures. The template needs Opportunity fields, Account billing address, the primary Contact, and Quote line items as repeating rows. Your solution must handle that without code and keep the signed PDF on the Opportunity record.

How to generate PDF from Salesforce records in clicks

This is a practical admin plan you can follow. The steps assume you have admin rights and can create templates, Quick Actions and Flows.

1) Prepare your Word template

  • Open the 60-page agreement and tag placeholders where values go. Keep a single source Word file rather than many manual copies.
  • Plan the repeating sections: line items from Quote or OpportunityLineItem should be a table that repeats for each row.

2) Upload and map the template

Upload the template into your document generation tool’s template library and map it to the primary object you’ll run from — typically Opportunity or Quote. Make sure you can reference parent lookups (Account, Contract) up to five levels, and include child rows for line-items or custom children like Renewal__c.

3) Pick where finished documents live

  • If your final documents are larger than 25 MB, use Salesforce Files. Notes and Attachments is capped at 25 MB and cannot be raised.
  • Decide per-template whether the finished PDF files attach to Opportunity, Quote or Contract records.

4) Wire a trigger with clicks — Quick Action or Flow

Two typical admin-friendly triggers:

  • Quick Action (button) on the Opportunity page layout. Users click "Generate Contract" and the connector fills the template, creates the document and attaches it to the Opportunity.
  • Record-triggered Flow: create a Flow that runs when Opportunity.StageName changes to a target stage (for example a Stage called "Contract") and calls the document-generator action to produce and store the PDF automatically.
// Example Flow outline (for your checklist, not copy-paste)
Record-Triggered Flow: Opportunity
  Entry Condition: StageName = 'Contract'
  Action: Generate Document (TemplateId, RecordId)
  Action: Send for Signature (if required)

Merge Word templates Salesforce: signature options and audit trail

Once the document is generated you’ll want signatures and an audit trail. Make these configuration choices:

  • Signature service: use your organisation’s own Circularo account to send. The signed PDF is written back to the same record automatically.
  • Signature positioning: use anchor tags in the template so signature fields stay correct even if pagination changes — no page-number hardcoding.
  • Signer identity: enable an emailed one-time code for recipients, and optionally require a per-signer password pulled from a field on the signer’s Contact or User record.
  • Bundling: if a transaction needs several templates (cover letter, order form, and full agreement), bundle them into a single signature run so signers receive one package and you get one signed PDF back attached to the Opportunity.

Common admin gotchas

  • Permissions: make sure the integration user or connection has read access to parent and child objects you want pulled into templates (Account, Contact, Quote, OpportunityLineItem, custom objects like Renewal__c).
  • Storage choices: if your templates produce files near 40 MB, switch to Files. Documents up to 40 MB are supported; Notes and Attachments is limited to 25 MB.
  • Sandbox parity: test in a sandbox — the connector works the same in sandboxes as in production, so your Flow and Quick Action testing will be accurate.

What you should expect after implementation

From an admin perspective you’ll gain repeatable output: every Opportunity at the chosen stage will produce a consistent PDF with data from the record and related lists. Signing becomes a tracked step from your Circularo account and the signed document lands on the Opportunity so your sales and legal teams can find it without hunting email threads.

If you want a checklist to try in your org:

  • Create a Word template with anchor-based signature placeholders.
  • Upload it and map primary object and repeating child rows.
  • Set storage to Files if your doc size could exceed 25 MB.
  • Add a Quick Action and a Record-Triggered Flow for the same template and test both paths in a sandbox.
  • Enable one-time code or per-signer password if you need stronger signer identity.

Savvy DocuGen fills Word and PDF templates from any Salesforce record (standard or custom), reaches five levels of parent lookups plus child/grandchild repeating rows, files the finished document back to the record, and sends for signature through your own Circularo account. There’s no managed package to install — it connects through an authorised connection and works the same in sandboxes as in production.

If you want to try this in your sandbox, set up a template for an Opportunity, create a Quick Action and a simple record-triggered Flow, and run a test Opportunity through the contract stage. Try it in your sandbox now.

Read next