# Document Options Quick Reference

Use this version when you want the same quick reference in table format.

### Attachment and File Name Format

<table data-full-width="true"><thead><tr><th width="117.6666259765625">Setting</th><th width="113.6666259765625">Purpose</th><th>Syntax</th><th width="123">Default</th><th width="127.6666259765625">Supports</th><th width="129.3333740234375">Best fit</th><th>Notes</th></tr></thead><tbody><tr><td><strong>Attachment and File Name Format</strong></td><td>Define the naming pattern for generated documents.</td><td>Text string with optional merge fields. Use single braces: <code>{!Object.Field}</code>.</td><td><code>SD-####.pdf</code></td><td>Standard fields, custom fields, lookup fields up to 5 levels, and user fields like <code>{!User.FirstName}</code></td><td>Use it when generated files need to be searchable and easy to identify outside Salesforce.</td><td>Keep names under 80 characters when possible. The maximum length is 255 characters. Include the <code>.pdf</code> extension. Null merge fields resolve to blanks. Very long names may be truncated by the file system.</td></tr></tbody></table>

**Examples:**

```
Proposal for {!Opportunity.Account.Name}
Legal Contract - {!DocumentID}
{!DocumentName} for {!Opportunity.Account.Name}
```

**Restricted Characters:**

<pre><code><strong>/ \ : * ? " &#x3C; > |
</strong></code></pre>

**Supported Merge Fields:**

* Standard fields from base object
* Custom fields
* Lookup fields (up to 5 levels)
* User fields: `{!User.FirstName}`

***

### Attachment & File Options

<table data-full-width="true"><thead><tr><th>Setting</th><th width="156.666748046875">Purpose</th><th>What happens when enabled</th><th>Use when</th><th>Watch for</th></tr></thead><tbody><tr><td><strong>Create Salesforce Attachment and link to record</strong></td><td>Automatically create an attachment in <strong>Notes &#x26; Attachments</strong>.</td><td>Creates an attachment on each generation. Uses the output file name. Links it to the base record.</td><td>Use it only when another process still depends on legacy attachments (uncommon).</td><td>Counts toward Attachment storage. Not recommended for most new implementations.</td></tr><tr><td><strong>Create Salesforce File and link to record</strong></td><td>Automatically create a file in <strong>Salesforce Files</strong>.</td><td>Creates a file on each generation. Uses the output file name. Links it to the base record. Supports sharing and collaboration.</td><td>Use it for most Lightning-first and modern Salesforce implementations.</td><td>Counts toward Files storage. Review file sharing rules if access matters.</td></tr><tr><td><strong>Create Salesforce Attachment only when emailed</strong></td><td>Create an attachment only if the document is emailed.</td><td>Skips attachment creation for download-only or preview-only actions. Creates the attachment only during email send flows.</td><td>Use it to reduce storage when many generated documents are never emailed.</td><td>Applies only to Attachments. It does not control Files.</td></tr><tr><td><strong>Delete related Salesforce Attachment/File upon S-Doc deletion</strong></td><td>Control whether generated files are deleted with the S-Doc record.</td><td>Deleting the S-Doc record also deletes related files or attachments. If disabled, the related files remain.</td><td>Keep it enabled for cleaner storage and fewer orphaned records.</td><td>Disable it only when retention rules require files to remain after the S-Doc is removed.</td></tr><tr><td><strong>Allow Edit</strong></td><td>Enable <strong>Live Edit</strong> for generated documents.</td><td>Adds an <strong>Edit</strong> option on generated documents. Users can open the file in a browser-based editor and save changes.</td><td>Use it for working drafts and minor post-generation edits.</td><td>Avoid it for legal, compliance, or highly formatted documents. Requires the <strong>S-Docs Edit Document</strong> permission.</td></tr><tr><td><strong>Allow naming of new Salesforce Attachment with each edit</strong></td><td>Let users rename attachments created during edits.</td><td>Prompts the user to enter a new attachment name after editing.</td><td>Use it when users need more descriptive version names.</td><td>Requires <strong>Allow Edit</strong> and works only when <strong>Create new Salesforce Attachment with each edit</strong> is also enabled.</td></tr><tr><td><strong>Create new Salesforce Attachment with each edit</strong></td><td>Create a new attachment on every edit instead of overwriting the old file.</td><td>Preserves prior versions by creating a fresh attachment after each edit.</td><td>Use it when version tracking matters more than storage efficiency.</td><td>Requires <strong>Allow Edit</strong>. Increases Attachment storage over time.</td></tr><tr><td><strong>Show Content Version JSON field</strong></td><td>Reveal a field for setting custom values on the generated <strong>ContentVersion</strong> record.</td><td>Shows the <strong>Content Version Field Assignment JSON</strong> input and lets you map custom values to file metadata fields.</td><td>Use it when downstream reporting, automation, or integrations depend on custom file metadata.</td><td>Works only with Salesforce Files. Fields must exist on <strong>ContentVersion</strong>. Invalid JSON causes errors. Merge fields inside the JSON use double braces: <code>{{!Field}}</code>.</td></tr></tbody></table>

**Show Content Version JSON field Example:**

```
{
  "Checkbox__c": "true",
  "Date_Created__c": "{{!Opportunity.CloseDate}}",
  "Type_Picklist__c": "Quote",
  "Type_Text__c": "{{!Opportunity.Name}}",
  "Decimal_Value__c": "12.34",
  "Integer_Value__c": "1234"
}
```

***

### Document Options - Other Options

<table data-full-width="true"><thead><tr><th>Setting</th><th>Purpose</th><th width="110.666748046875">Type</th><th>What happens when enabled or set</th><th>Use when</th><th>Watch for</th></tr></thead><tbody><tr><td><strong>Template contains international characters (Unicode fonts)</strong></td><td>Enable Unicode character support.</td><td>Checkbox</td><td>Allows non-English and non-Latin characters to render correctly. Works with the Unicode enforcement setting.</td><td>Use it for accented characters, non-Latin scripts, or special symbols.</td><td>Enable it before testing translated or multilingual output.<br><br><a data-mention href="#unicode-enforcement-options">#unicode-enforcement-options</a></td></tr><tr><td><strong>Show warning messages during document generation (Legacy)</strong></td><td>Control whether non-critical warnings appear during generation.</td><td>Checkbox</td><td>Shows warning messages such as null merge fields, missing lookup data, field access issues, and non-critical formatting warnings.</td><td>Keep it enabled during testing and rollout.</td><td>Disable it only when known warnings create noise for users. Critical errors still appear.</td></tr><tr><td><strong>Redirect back to record</strong></td><td>Return users to the source record after generation.</td><td>Checkbox</td><td>Sends the user back to the base record after the document is generated.</td><td>Use it when document generation is part of a record-based workflow.</td><td>Leave it disabled when users usually review, edit, or email the document next.</td></tr><tr><td><strong>Attach related case articles to outbound email</strong></td><td>Include related case articles in the outbound email.</td><td>Checkbox</td><td>Adds related case articles to the email along with the generated document.</td><td>Use it for case response templates and support workflows.</td><td>Works only when the base object is <strong>Case</strong> and only during email send flows.</td></tr><tr><td><strong>Unicode enforcement level</strong></td><td>Set how aggressively Unicode handling is applied.</td><td>Picklist</td><td>Controls how strongly S-Docs enforces Unicode rendering. Options are blank or none, <strong>Data</strong>, and <strong>Strict</strong>.</td><td>Increase it only when Unicode output needs more support.</td><td>Higher levels add processing overhead. Also enable <strong>Template contains international characters</strong>.</td></tr><tr><td><strong>Maximum versions retained in archive</strong></td><td>Limit how many saved template versions are kept.</td><td>Text field (numeric)</td><td>Creates a new template version on each save and deletes the oldest versions when the limit is reached.</td><td>Use lower values for stable templates and higher values for heavily revised templates.</td><td><code>0</code> or blank keeps all versions and can increase storage over time.<br><br><a data-mention href="#maximum-versions-retained-in-archive-options">#maximum-versions-retained-in-archive-options</a></td></tr><tr><td><strong>List of merge fields that cannot be null</strong></td><td>Block generation if required merge fields are empty.</td><td>Text area</td><td>Runs validation before generation. If any listed field is null, generation stops and the user sees an error.</td><td>Use it to enforce required business data before users generate a document.</td><td>Enter one field per line. Use double braces: <code>{{!Object.Field}}</code>. Do not use commas or semicolons.<br><br></td></tr></tbody></table>

#### Unicode Enforcement Options

<table data-full-width="true"><thead><tr><th>Unicode enforcement level</th><th>Description</th><th>Performance impact</th><th>Best fit</th><th>Notes</th></tr></thead><tbody><tr><td><code>(blank/None)</code></td><td>Standard handling</td><td>Fast</td><td>English-only documents</td><td>Use the default when Unicode support is not needed.</td></tr><tr><td><code>Data</code></td><td>Enforces Unicode in merge fields</td><td>Minimal</td><td>Western European languages</td><td>Good for accented Latin characters and lighter multilingual needs.</td></tr><tr><td><code>Strict</code></td><td>Full Unicode enforcement</td><td>Moderate</td><td>Asian, Arabic, Hebrew, and other complex scripts</td><td>Use it only when lower levels do not render characters correctly.</td></tr></tbody></table>

#### **Maximum versions retained in archive Options**

<table data-full-width="true"><thead><tr><th width="116">Archive value</th><th>Result</th><th>Best fit</th><th>Notes</th></tr></thead><tbody><tr><td><code>10</code></td><td>Keep the last 10 versions</td><td>Stable templates with occasional edits</td><td>Reduces stored version history.</td></tr><tr><td><code>25</code></td><td>Keep the last 25 versions</td><td>Templates under active revision</td><td>A balanced default for many teams.</td></tr><tr><td><code>50</code></td><td>Keep the last 50 versions</td><td>Complex templates with frequent changes</td><td>Keeps more rollback points.</td></tr><tr><td><code>0</code> or blank</td><td>Keep all versions</td><td>Rarely recommended</td><td>Use only when full retention is required and storage is monitored.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.sdocs.com/sdocs/template-architecture/template-settings/document-options-tab/document-options-quick-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
