Template Lifecycle Management
Preview, export, import, and maintain templates across development and deployment cycles.
Once you have perfected a template in your Salesforce Sandbox, you need a safe and reliable way to move it into your Production environment (or share it with another org entirely). S-Docs makes this easy by allowing you to export your entire template configuration as a portable text string.
How to Export a Template
Exporting a template packages its entire structure—including the HTML body, page settings, email configurations, and runtime prompts—into a single JSON text string.
Open the template you want to export and click into the Template Editor.
Navigate to the Advanced Options tab.
Under the "Export Template" section, click the Generate button.
A large text box will appear containing a long string of JSON code.
Click Copy (or manually select all the text and copy it).
Paste this text into a plain text file on your computer (e.g., Notepad or TextEdit) and save it.
Best Practice for Version Control: Save your export files with a strict, descriptive naming convention so you can track your changes over time. For example:
QuoteTemplate_v1.0_2024-02-04_Initial.txtorQuoteTemplate_v1.1_2024-02-15_AddedPrompts.txt.
How to Import a Template
To bring your exported template into a new environment, you simply need to paste that JSON code into the target org.
Log into your Target Org (e.g., your Production environment).
Navigate to the S-Docs Templates tab and click the New Template button.
Look for the Import option. (Note: Depending on your specific S-Docs version, this may be located on the template list view, the template detail page, or the initial creation screen).
Paste the entire JSON string you copied during the export process.
Click Import or Create Template.
Your template will instantly generate with all of your settings and content intact!
The Migration Checklist
Because no two Salesforce orgs are exactly identical, you must ensure your Target Org is prepared to receive the template.
What Migrates vs. What Doesn't
Automatically Included in Export
NOT Included (Must be manually recreated)
Template body (HTML/CSS)
Actual Salesforce record data
Page, Document, and Task Settings
Template permissions and sharing settings
Email Settings & Runtime Prompts
S-Docs button configurations
Formatting, styling, and merge fields
Org-specific IDs (like a Preview ID)
Pre-Import Prerequisites
Before you hit "Import" in your new org, verify the following elements exist:
Custom Fields & Objects: All custom fields and objects referenced in your template must exist in the target org. The API names and field types must match exactly.
Record Types: If your template relies on specific record types, their Developer Names must match.
S-Docs Version: Ensure the target org has the same (or a compatible) version of S-Docs installed.
Post-Import Configuration
Immediately after importing, you need to reconfigure any settings that rely on org-specific data:
Update Org-Wide Emails: If your template sends from a generic company address, you must reselect that verified address in the target org's Email Settings tab.
Update the Preview ID: Your old test record ID from the Sandbox does not exist in Production! Find a valid record ID in your new org and paste it into the Advanced Options tab to restore your preview functionality.
Test End-to-End: Always generate a test document, verify the merge fields populated correctly, and send a test email to ensure your routing is working.
Troubleshooting Common Import Errors
Error Message
Why it Happened
How to Fix It
"Field does not exist"
The target org is missing a custom field referenced in the template.
Create the missing custom field in Salesforce with the exact same API name, or delete the merge field from the template.
"Invalid org-wide address"
The sender address verified in your Sandbox is not verified in Production.
Recreate and verify the Org-Wide Address in Salesforce Setup, then reselect it in the Template Editor.
"Record type not found"
The target org is missing a record type used by your template.
Recreate the record type in the new org, ensuring the Developer Name matches the original.
Last updated
Was this helpful?

