If your reps are waiting days for contracts because PDFs need manual edits, or admins are rebuilding templates for every Opportunity, you have a Salesforce document generation problem. DocuGen for Salesforce can stop that bottleneck — but only if you set templates and data mappings correctly. This post walks a Salesforce Admin through the exact fixes that cut generation time, avoid bad merges, and get signatures back faster.
Why Salesforce document generation breaks — and the quick wins
Here are the usual reasons generation goes wrong and what you can do today, no code required.
1. Templates expect the wrong record
Admins often build a template assuming the current object is Account when the button is on Opportunity, or vice versa. If your template uses {{Account.Name}} but your button is on Opportunity, the merge fails or leaves blanks.
- Check where your DocuGen button or trigger runs from: Opportunity, Quote, Contract, or a custom object (for example
Contract__c).
- If a template needs fields from the Account tied to the Opportunity, map those fields explicitly or place the button on the Account page instead.
2. Line items and repeating rows are missing
Line items (QuoteLineItem, OpportunityLineItem, or custom child objects) usually need to appear as repeating table rows in the document. If you built a single-field merge, you'll see only the first row or nothing.
- In your template, create a repeating table section and tell DocuGen to use the child relationship (for example
Quote.QuoteLineItems or Opportunity.OpportunityLineItems).
- Preview with a real Opportunity that has multiple line items to confirm pagination and totals.
DocuGen for Salesforce: template setup that actually works
DocuGen for Salesforce fills Word and PDF templates from any Salesforce record and supports child rows and up to five levels of parent lookups. Treat template setup like a checklist.
Checklist for reliable templates
- Use a single source record. If you trigger from Opportunity, make Opportunity fields your primary placeholders.
- Include parent lookups only when necessary. DocuGen supports up to five levels, but every lookup increases merge complexity — keep it shallow where possible.
- For repeating data, use child relationship placeholders. Test with three or more rows to confirm table break behavior and header repetition.
- Anchor signature tags in the Word template rather than fixed coordinates. Anchor tags survive repagination and keep signatures in the right place when page count changes.
Practical example
Hypothetical example: you send a 60-page Master Services Agreement where each Opportunity has 10 line items and your team processes 200 renewals a month. If templates are wrong, admins spend hours per month stitching PDFs and chasing missing clauses. Set the template to run from Opportunity, include Opportunity.Owner and Account.BillingAddress via parent lookups, and add an Opportunity line-items repeating table. That removes manual edits and keeps the bundle stable at scale.
e-signature in Salesforce: getting signatures back faster
Sending for signature and getting PDFs back is where most processes stall. DocuGen supports sending through your organisation's Circularo account and writes the signed PDF back to the same record — here's how to stop signature delays.
Reduce signature friction
- Place signature anchor tags in the Word template so tags don't move when the document repaginates.
- Use per-signer settings: you can require an emailed one-time code and a per-signer password stored in the signer’s Salesforce Contact record.
- Bundle templates when one signature run should include multiple documents (a cover sheet plus the main agreement). That saves recipients from multiple email threads.
File placement and size limits
DocuGen files the finished document back in Salesforce Files or Notes and Attachments per template. Notes and Attachments is capped at 25 MB by Salesforce, so use Files for larger documents up to 40 MB. Confirm your template outputs stay under your chosen storage method's limit.
Triggers and real-world admin tips
DocuGen runs from a button, a stage change, a field change, or when a new file is added. Use the trigger that fits your workflow.
- Button: gives users control. Good for one-off exports and ad hoc bundles.
- Stage change (Opportunity.StageName): automates routine sends when a deal reaches Contract Signed stage. Add guard conditions to avoid accidental sends.
- Field change or new file: useful for contract renewals where a specific flag flips or a signed amendment is attached.
Small Admin tips you'll thank yourself for later:
- Keep a testing folder of sample records (Opportunity with multiple line items, Account with billing and shipping addresses, Contact with email) to preview templates.
- Document your template naming convention: include object and purpose, e.g.,
Opportunity-Standard-MSA-Template.docx.
- Train the team on when to use Files vs Notes & Attachments so signed PDFs don't disappear into the wrong storage type.
Savvy DocuGen connects without a managed package and works the same in sandbox and production, so you can build and test safely. If you want to cut the wasted hours your reps and admins spend on manual PDFs and signature follow-ups, try DocuGen for Salesforce in your sandbox today.
Try DocuGen for Salesforce in your sandbox to map one template and send a test signature bundle.
Read next