Back to the blog

How to automate document generation and e-signatures in Salesforce

Automation 6 min read 19 October 2026

The problem: too many clicks, too many versions

You update an Opportunity, then open Word, copy pricing, paste addresses, attach the wrong appendix, export to PDF, email it, and wait for a signature. You do that for a 60-page master services agreement and for 200 renewals a month. It's slow, it's error-prone, and chasing signatures takes an average of several days.

Why automate document generation in Salesforce

When you automate document generation you remove manual copy-paste, enforce approved wording, and keep the final file on the Salesforce record where it belongs. For you as an admin that means fewer support tickets and fewer versioning mistakes on Opportunity, Quote and Contract records.

Typical admin pain points

  • Sales reps email different contract versions; finance rejects them during review.
  • Attachments get lost: the signed PDF isn't stored on the Contract or Opportunity.
  • Templates live in people’s drives instead of a governed system.
  • Signature positions break when a template repaginates — and the signer block vanishes.

How to set up Salesforce document generation without code

Here’s a click-first approach you can implement in a sandbox in a day. The steps below assume you already have Word/PDF templates with your approved text and signature anchor tags.

1. Build your templates

  • Create Word templates for each document type (SOW, MSAs, Quote PDF). Use anchor tags for signature locations so they survive repagination.
  • Design repeating table rows in the template for line-items that come from child records (QuoteLineItem, custom Invoice__c items).
  • Keep large exhibits as separate templates so you can bundle them into one signed package when needed.

2. Map merge fields and lookups

Your merge engine should read fields from the current record and up to five parent lookup levels (Account, Parent Account, Region__c, etc.). Confirm the template pulls contact details from the Contact lookup and billing addresses from Account. For repeating rows, map child object fields such as QuoteLineItem fields into the template table row.

3. Store generated documents in Files

Decide whether to use Files or Notes & Attachments. Files supports documents up to 40 MB; Notes & Attachments is capped at 25 MB. For large PDFs or multiple bundled templates, save to Files on the Opportunity, Quote or Contract record.

4. Send for signature through your Circularo account

When the document is ready, send it through your organisation's Circularo account so the signature flow is controlled by your company. Signer identity can require an emailed one-time code and a per-signer password pulled from that signer’s Contact or User record. The signed PDF is written back to the same Salesforce record after completion.

Triggering Salesforce document generation and send documents for signature

Pick triggers that make sense for your process. You can start a generation and signature run from a button, an Opportunity stage change, a field update, or when a new file is uploaded to a record. For admins, Record-Triggered Flows handle this without Apex.

// Example Flow outline (Record-Triggered Flow on Opportunity.StageName change)
1. Trigger: Opportunity where StageName changes to "Contract Sent"
2. Get Records: Opportunity -> Account, Primary Contact
3. Action: Call DocuGen template "MSA + Pricing" (merge fields + child QuoteLineItems)
4. Action: Save output to Files on Opportunity
5. Action: Send document for signature via Circularo (signers: Primary Contact, CFO)
6. Update Opportunity: set "Agreement Sent Date" and attach signed file link when returned

You don't need to write Apex. Configure the Flow and point the merge action at your templates and signer list. If you prefer manual control, a button on the Quote or Contract record can start the same actions with a single click.

Common gotchas admins face

  • File storage: large bundled PDFs should go to Files, not Notes & Attachments. Watch the 25 MB limit on Notes & Attachments.
  • Signer placement: use anchor tags in templates so signature fields keep their place after repagination.
  • Lookup depth: confirm your templates need to read up to five levels of parent lookups — if you need more, redesign where the data lives.
  • Sandbox testing: test in a sandbox — production behaviour will match sandbox behaviour exactly, including signature flows.
  • Access control: decide which profiles can trigger generation and who can see the stored signed PDFs on Contract, Quote or Opportunity.

Concrete scenario

Say you manage renewals and you generate a 60-page renewal package per customer. You handle 200 renewals a month. If you automate: a Flow can merge Opportunity, Account and custom Renewal__c data into the 60-page template, bundle the SLA exhibit, send the bundle for signature to two signers via Circularo, and save the signed PDF to the Contract record. Instead of several manual hours and a multi-day signature chase, the whole run can be one click from the Opportunity stage change.

What to do next

If you want to stop babysitting document versions, build templates now, test a Flow in your sandbox, and pick one trigger: a button, an Opportunity stage change, or a field update. Keep the first template simple: one document, one signer. Once that works, add bundles, child rows, and per-signer password checks.

Savvy DocuGen fills Word and PDF templates from any Salesforce record (standard or custom), reaches five levels of parent lookups, supports child and grandchild repeating rows, bundles templates for one signature run, and returns the signed PDF to the originating record. Signature runs use your Circularo account and signature positions use anchor tags so they survive repagination. Try it in your sandbox and run your first automated generation and signature flow today.

Read next