The problem in two sentences
Your Salesforce document generation is failing at the last mile: Word templates repaginate, fields pull blanks, and signatures end up on the wrong page. If you’re the admin who owns Opportunity, Contract or Quote templates, you need a short checklist you can run now — without a developer — so merges and signature runs stop breaking.
Why Salesforce document generation fails in real orgs
There are a few predictable causes that trip admins up. I’ll call them out so you can test them quickly.
Template design: Word traps
Admins often use fixed page layouts or absolute positioning in Word. That looks fine in the editor but won’t survive different record data. A 60-page service agreement that expands a clause by a paragraph will shift everything, and any signature placed by fixed coordinates moves with it.
Data mapping: missing parents and repeating rows
Merges fail when templates expect fields from parent records you haven’t included. If your template pulls Account.Parent.Parent.Parent (yes, that deep), confirm your tool supports deep lookups. Line items from Quote or a custom Order__c need to be inserted as repeating table rows, not pasted as a static list.
Signing: coordinates vs anchor tags
Hard-coded signature coordinates break when pagination changes. Anchor tags survive repagination. If your signature provider uses anchors, signatures will land where you intended even when a clause expands by a page.
Storage and sizes
Notes & Attachments is convenient but capped at 25 MB. Large merged files or bundles will silently fail to save. Also confirm whether your process writes back the signed PDF to the record and whether that's Files or Notes & Attachments.
How to fix Salesforce document generation: merge Word template Salesforce best practices
Run these six checks in your sandbox. Each one is something you can do with clicks or a short Flow change.
-
1. Open the Word template and remove absolute positioning
Replace fixed text boxes with normal paragraphs and tables. Use Word table cells for layout and let the document flow. That prevents repagination surprises when clauses get longer.
-
2. Confirm lookups: use up to five parent levels
Check every merge field that references Account, Contact, Opportunity, Quote, Contract or custom objects like Order__c. If the field lives on a grandparent, your generator must support multi-level lookups — otherwise add the fields to the primary record as formula fields so the merge can find them.
-
3. Use repeating table rows for child records
Line items belong in repeating rows. For QuoteLineItem, OpportunityLineItem or a child object like OrderItem__c, verify that your template maps a repeating section so totals and quantities expand without manual edits.
-
4. Switch signatures to anchor tags
Do not place signatures by X/Y coordinates. Insert a small anchor string in the template like [SIGN_HERE:COUNTER=1] and tell the signer tool to use that anchor. It keeps signer blocks attached to the right clause through pagination.
-
5. Decide Files vs Notes & Attachments
If your generated PDF can exceed 25 MB (bundles or long agreements) plan to save to Salesforce Files. Check the template settings: some tools let you choose per-template destination.
-
6. Pick a simple trigger and test it
Triggers that work for admins: a button click on Opportunity, a stage change to Closed Won, a field change on Contract, or when a new file is attached. Test with one record first and run both the merge and the signature flow to catch mapping problems before you roll out.
Quick test scenario you can run in a sandbox
Pick one Opportunity with a Quote that has five QuoteLineItems. Use a 10-page Word template that pulls Opportunity fields, the Quote’s billing address, and the Account parent name. Insert an anchor tag at the signature location. Trigger the merge with a button and send the result for signature.
If the merged document looks correct, the repeating rows populate, and the signature lands on the right page after the signer completes, you’ve fixed the common issues. If anything breaks, check the specific step above: table rows, parent lookup or anchor placement.
Example Flow step (click-based example)
1. Screen Flow: Get Opportunity (recordId)
2. Get Records: Quote where OpportunityId = {!Opportunity.Id} LIMIT 1
3. Get Records: QuoteLineItems where QuoteId = {!Quote.Id}
4. Action: Generate Document (select template)
- Map: Opportunity.Id, Quote.Id
- Output: FileId
5. Action: Send for Signature (FileId, Signers from Quote.ContactId)
6. Update Record: Add FileId to Opportunity.Files
Where things still go wrong
If signatures still land wrong after anchor tags, confirm your signer tool supports anchor-based placement and that the anchor text is unique and not split by Word formatting. If merges show blank fields, add debug text next to the merge field in the Word template (for example <<Account.Name>> - debug) so you can see what the merge engine actually receives.
What Savvy DocuGen does for you
Savvy DocuGen fills Word and PDF templates from any Salesforce record, including five parent lookup levels and repeating child rows. It files the finished document to the record in Salesforce Files or Notes & Attachments per template, and sends for signature through your Circularo account. Signatures use anchor tags so they survive repagination, and signed PDFs are written back to the same record. The connector works in sandboxes exactly as in production and connects via an authorised connection — there’s no managed package to install.
Try it in your sandbox: pick one template, map the fields, add an anchor for signature, and run a test on an Opportunity or Contract record. If it runs clean there, you can scale to your production templates with confidence.
Read next