# Document Options Tab

Use **Document Options** to control what happens after a user clicks **Generate**.

This tab controls how documents are named, saved, edited, archived, and handled during generation.

{% hint style="info" %}
Use **Document Options** for file behavior and general generation settings.

Use **Email Settings** for email recipients and sender controls.

Use **Create Salesforce Task** for follow-up task automation.
{% endhint %}

### What you can configure in Document Options

The **Document Options** tab includes three main areas:

* **Attachment & File Name Options** — control the generated file name.
* **Attachment & File Options** — control where the generated document is saved and whether users can edit it.
* **Other Options** — control Unicode, warnings, redirects, archive limits, and validation behavior.

### Attachment and file name options

Use this section when you need predictable output names.

| Label                               | Description                                                                                                                                                         |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Attachment and File Name Format** | Set a custom generated file name, replace generic numbered file names with record-based names, and keep naming consistent across downloads, attachments, and files. |

Use single-brace syntax in file name formulas: `{!Object.Field}`.

Related guide:

* [How to Create Dynamic File Names](/sdocs/template-architecture/template-settings/document-options-tab/how-to-create-dynamic-file-names.md)

### Attachment and file options

Use this section to decide what S-Docs saves after generation.

| Label                                                             | Description                                                           |
| ----------------------------------------------------------------- | --------------------------------------------------------------------- |
| **Create Salesforce Attachment and link to record**               | Create a legacy **Salesforce Attachment** and link it to the record.  |
| **Create Salesforce File and link to record**                     | Create a **Salesforce File** and link it to the record.               |
| **Create Salesforce Attachment only when emailed**                | Create an attachment only when the document is emailed.               |
| **Delete related Salesforce Attachment/File upon S-Doc deletion** | Delete related files or attachments when the S-Doc record is deleted. |
| **Allow Edit**                                                    | Enable **Live Edit** for generated documents.                         |
| **Allow naming of new Salesforce Attachment with each edit**      | Let users rename attachments created during edits.                    |
| **Create new Salesforce Attachment with each edit**               | Create a new attachment on each edit.                                 |
| **Show Content Version JSON field**                               | Show the file metadata mapping field.                                 |
| **Content Version Field Assignment JSON**                         | Map custom metadata to the generated Salesforce File.                 |

Use **Salesforce Files** for most new implementations.

Use legacy attachments only when another process still depends on them.

Related guides:

* [How to Auto-Attach Documents to Records](/sdocs/template-architecture/template-settings/document-options-tab/how-to-auto-attach-documents-to-records.md)
* [How to Map Custom Metadata to Salesforce Files (ContentVersion)](broken://spaces/WKNnJmhJBQwhdk5WBFsi/pages/iZVtSM5qJQBpRTPtUd7e)
* [How To: Editing Generated Documents](/sdocs/automation-and-document-lifecycle/workflows/editing-generated-documents-live-edit.md)

### Other options

Use this section for general generation behavior and guardrails.

| Label                                                          | Description                                                       |
| -------------------------------------------------------------- | ----------------------------------------------------------------- |
| **Template contains international characters (Unicode fonts)** | Enable Unicode support for international characters.              |
| **Unicode enforcement level**                                  | Set the Unicode enforcement level.                                |
| **Show warning messages during document generation**           | Show or suppress non-critical warning messages during generation. |
| **Redirect back to record**                                    | Redirect users back to the record after generation.               |
| **Attach related case articles to outbound email**             | Attach related case articles to outbound email.                   |
| **Maximum versions retained in archive**                       | Set the maximum number of archived template versions to retain.   |
| **List of merge fields that cannot be null**                   | Require specific merge fields to be non-null before generation.   |
| **Enable Rich Text in Runtime Prompts Tab**                    | Enable rich text support in runtime prompts.                      |

Related guide:

* [How to Handle International Characters](/sdocs/template-architecture/template-settings/document-options-tab/how-to-handle-international-characters.md)


---

# 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.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.
