Edit and Update an Existing Document Template in Dochly
Before you edit a live template
A live template is actively generating documents. Any change you make — even a small one — affects every document generated from that point forward. Before touching a published template, ask these three questions:
Write down the specific change before opening the editor. "Update the contract" is not specific enough. "Replace the liability clause in Section 7 with the new legal-approved version" is. Vague edits lead to unintended changes.
Which teams generate documents from this template? Who needs to know the template is changing? Legal, finance, and sales ops teams should be notified before any template update that affects the content of their documents.
For contracts and invoices especially — historical documents were generated from a specific template version. If you overwrite the template, you lose the ability to trace exactly what language or pricing was in effect at a given point in time.
Some updates should go live immediately (fixing a broken merge field). Others should be timed carefully — a pricing change in a proposal template should go live only when the new pricing is officially effective, not mid-quarter.
Never edit a published template directly if it generates legal or financial documents. Always duplicate first, make changes to the copy, test thoroughly, then swap. This protects your audit trail and gives you a fallback if something goes wrong.
Types of changes and risk levels
Not all template changes carry the same risk. Understanding what kind of change you're making helps you choose the right approach — quick in-place edit vs. full duplicate-and-replace workflow.
Low risk — can edit in place
- Fixing a typo in static text
- Updating company phone or email
- Adjusting font size or spacing
- Adding a missing merge field
- Updating the logo file
Medium risk — duplicate recommended
- Adding or removing a section
- Changing header or footer layout
- Adding a new conditional block
- Updating payment terms language
- Restructuring the line items table
High risk — always duplicate first
- Changing legal clause language
- Updating pricing or commercial terms
- Adding or removing signature blocks
- Changing the primary Salesforce object
- Restructuring the entire document
The safe editing approach
The safest way to update any published template — regardless of change type — is the duplicate, edit, test, swap approach. This ensures:
- The live template continues generating correctly while you build the update
- You can test the new version thoroughly before anyone generates a real document from it
- The previous version is preserved as an Inactive template for audit and reference
- You can instantly roll back by reactivating the old template if something is wrong with the new version
For minor edits on non-legal templates (formatting fixes, typo corrections), editing in place is acceptable. For anything that changes document content, the duplicate-first approach takes 5 extra minutes and prevents hours of cleanup if something goes wrong.
Step-by-step: editing a template safely
Identify exactly what needs to change
Before opening the template editor, document the specific change you need to make. If it's a legal clause update, get the approved new language in writing from legal before you start. If it's a pricing change, confirm the exact new values. This prevents mid-edit decisions that introduce additional unplanned changes.
Duplicate the existing template
In the Dochly Templates list, find the template you want to update. Click Duplicate (or Clone). This creates an exact copy with Draft status — the original remains Active and continues generating documents while you work on the copy.
Name the duplicate clearly to indicate it's the new version — for example: "Sales Contract — Enterprise v2" or "Invoice — Standard (June 2026 Update)". See managing multiple templates for naming conventions.
Make your changes to the duplicate
Open the duplicated template (in Draft status) and make your changes. Because this is a Draft, no one can accidentally generate a document from it during your edit session. Take your time — there's no rush since the live template is still active.
Common changes and where to find guidance:
- Merge field changes → Add Salesforce merge fields guide
- Branding updates (logo, colors, fonts) → Build a branded template guide
- New conditional clauses → conditional logic syntax in this guide series
Test thoroughly before publishing
Use the Preview function to generate test documents from real Salesforce records. Test more scenarios than you think you need — especially for the sections you didn't change, which can sometimes be affected by adjacent edits.
Test checklist before publishing any update:
- All merge fields populate correctly — no blank or "null" outputs
- The changed section looks and reads correctly
- Unchanged sections are unaffected
- Conditional sections still trigger correctly
- Dynamic tables still expand as expected
- Page breaks and formatting look correct throughout
- The document generates successfully on at least 3 different records
If you find issues during testing: Template editor troubleshooting guide
Swap the active template
Once the new version is fully tested and ready, perform the swap:
- Set the old template status from Active → Inactive
- Set the new template status from Draft → Active
If your Flows or buttons reference the template by ID rather than by name, update the template reference in those automations to point to the new template's ID. If they reference by name, ensure the new template uses the same name as the old one — or update the Flow reference accordingly.
Archive the old version — don't delete it
Set the old template status to Inactive — this preserves it for audit, reference, and rollback. Do not delete old templates. Historical documents were generated from a specific template version, and deleting it removes your ability to verify what content was in the template at a given date.
Rename the archived template to make its status clear — for example: "Sales Contract — Enterprise [ARCHIVED June 2026]". See the full archiving and naming guide: Manage multiple document templates
Version control best practices
As your template library grows and templates go through multiple update cycles, clear version naming becomes critical. Here's what a well-managed template version history looks like:
Sales Contract — Enterprise v3
Current live version. Updated June 2026 — new liability cap language approved by legal. Used for all Enterprise deals from June 2026 onwards.
Sales Contract — Enterprise v2 [ARCHIVED Mar 2026]
Previous version. Used January–May 2026. Updated payment terms and added EU jurisdiction clause. Preserved for audit of Q1/Q2 2026 contracts.
Sales Contract — Enterprise v1 [ARCHIVED Jan 2026]
Original template. Used at launch through December 2025. Preserved for audit of all 2025 contract generation. Do not delete.
Include the archive date in the template name when retiring a version — for example [ARCHIVED June 2026]. This makes it immediately clear which template was active during which time period without having to open each one.
Common template updates and how to handle them
Risk: Minor. Can edit in place. Open the template, delete the existing logo image, upload the new logo file, resize to the same dimensions as before, and republish. Test with a preview to confirm the new logo renders correctly.
Risk: Major. Always duplicate first. New pricing must only apply to documents generated after the effective date — not retroactively. Archive the old version with the effective date in the name.
Risk: Major. Always duplicate first. Get written approval of the new language from legal before building it into the template. Never edit legal language in a live contract template directly.
Risk: Minor–Moderate. Confirm the Salesforce field exists and is populated on the records the template will be generated from. Test with records where the field is empty to ensure no "null" outputs.
Risk: Moderate. Duplicate recommended. Test the new condition with records that trigger it and records that don't — both paths must produce correct output before publishing.
Risk: Minor. Can edit in place but test all pages carefully — font changes can affect page breaks and layout in multi-page documents. Preview a long document specifically to check pagination.
Do's and don'ts when editing templates
- Duplicate the template before making major changes
- Document the change and who approved it before starting
- Test from at least 3 real Salesforce records before publishing
- Archive old versions with the date in the template name
- Notify affected teams before swapping the active template
- Check all conditional branches — not just the one you changed
- Update Flow references if the template ID changes
- Edit legal or financial templates directly without duplicating
- Delete old template versions — set to Inactive instead
- Publish without testing from real records
- Make changes during active deal cycles without notifying sales
- Assume unchanged sections are unaffected — test everything
- Edit a template while someone is actively generating from it
- Use the same name for the new version as the old one without archiving the old one first
Frequently asked questions
Following the duplicate-edit-test-swap approach keeps your template library clean, your audit trail intact, and your live document generation uninterrupted during updates. Next steps: Manage multiple document templates · Troubleshooting guide
Rated 5 stars · Native Salesforce app · Free to install