---
schema_version: "1"
id: 1cb74c9c3e883f9ef735eaa70a3431fe7668529766c60430b5fba4b20c27c7e6
title: DocumentGenerationSetting
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_documentgenerationsetting.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_documentgenerationsetting.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 270fe280377201306f1775db639052b30cf1a0ef394aa032d8a69ee597a0026b
description: Represents an org's settings for automatic document generation from templates. This type extends the Metadata metadata type and inherits its fullName field.
---
# DocumentGenerationSetting

Represents an org's settings for automatic document generation from templates. This type extends the Metadata metadata type and inherits its fullName field.

In the package manifest, all organization settings metadata types are accessed using the Settings name. See [Settings](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_settings.htm "Represents the organization settings related to a feature. For example, your password policies, session settings and network access controls are all available in the SecuritySettings component type.") for details.

## File Suffix and Directory Location

DocumentGenerationSetting components have the suffix documentGenerationSetting and are stored in the documentGenerationSettings folder. The .settings files are different from other named components because there’s only one settings file for each settings component.

## Version

DocumentGenerationSetting components are available in API version 52.0 and later.

## Special Access Rules

DocumentGenerationSetting is available if your org has the DocGen platform license and related addon and user licenses.

Server-side document generation isn't enabled by default, and selecting isServerSideDocGenEnabled isn't sufficient. To enable this feature, see the [Request Access to Server-Side Document Generation](https://help.salesforce.com/apex/HTViewSolution?urlname=Request-Access-to-Server-Side-Document-Generation&language=en_US) knowledge article.

## Fields

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d397987e117">Field Name</th>

              <th class="featureTableHeader  " id="d397987e120">Field Type</th>

              <th class="featureTableHeader  " id="d397987e123">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d397987e117" data-title="Field Name"><span class="keyword parmname">documentTemplateLibraryName</span></td>

              <td class="entry" headers="d397987e120" data-title="Field Type">String</td>

              <td class="entry" headers="d397987e123" data-title="Description">Required. The name of the library that stores the document templates to which
                this setting applies.</td>

            </tr>

            <tr>
              <td class="entry" headers="d397987e117" data-title="Field Name"><span class="keyword parmname">generationMechanism</span></td>

              <td class="entry" headers="d397987e120" data-title="Field Type">GenerationMechanism (enumeration of type string)</td>

              <td class="entry" headers="d397987e123" data-title="Description">Specifies how and where a document is generated. Valid values are:<div class="p">
                  <ul class="ul bulletList">
                    <li class="li">
                      <samp class="codeph nolang">ClientSide</samp>—Generates documents
                      in the browser with an optional preview.
                    </li>

                    <li class="li">
                      <samp class="codeph nolang">ServerSide</samp>—Generates documents
                      on the server and attaches them to the objects for which they're
                      generated.
                    </li>

                  </ul>

                </div>
                <p class="p">The default is <samp class="codeph nolang">ClientSide</samp>.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d397987e117" data-title="Field Name"><span class="keyword parmname">guestAccessNamedCredential</span></td>

              <td class="entry" headers="d397987e120" data-title="Field Type">String</td>

              <td class="entry" headers="d397987e123" data-title="Description">Specifies the named credential that lets guest users generate
                documents.</td>

            </tr>

            <tr>
              <td class="entry" headers="d397987e117" data-title="Field Name"><span class="keyword parmname">inProgDocGenRqstTmot</span></td>

              <td class="entry" headers="d397987e120" data-title="Field Type">Integer</td>

              <td class="entry" headers="d397987e123" data-title="Description">The time interval (in hours) after which InProgress<samp class="codeph nolang">DocumentGenerationProcess</samp> records (single point or batch request) are
                terminated and the request status is updated to Failed. Specify a valid whole number
                between 1 and 24. The default value is set to 6.</td>

            </tr>

            <tr>
              <td class="entry" headers="d397987e117" data-title="Field Name"><span class="keyword parmname">isInProgRqstTmotEnab</span></td>

              <td class="entry" headers="d397987e120" data-title="Field Type">Boolean</td>

              <td class="entry" headers="d397987e123" data-title="Description">Indicates whether the InProgress DocGen Request Time Out (hrs) is enabled
                (<samp class="codeph nolang">true</samp>) or not (<samp class="codeph nolang">false</samp>).</td>

            </tr>

            <tr>
              <td class="entry" headers="d397987e117" data-title="Field Name"><span class="keyword parmname">isServerSideDocGenEnabled</span></td>

              <td class="entry" headers="d397987e120" data-title="Field Type">Boolean</td>

              <td class="entry" headers="d397987e123" data-title="Description">Enables server-side document generation if the prerequisite license is present
                in the org.</td>

            </tr>

            <tr>
              <td class="entry" headers="d397987e117" data-title="Field Name"><span class="keyword parmname">masterLabel</span></td>

              <td class="entry" headers="d397987e120" data-title="Field Type">String</td>

              <td class="entry" headers="d397987e123" data-title="Description">Required. Specifies a name for the setting, such as <samp class="codeph nolang">DocGen</samp>.</td>

            </tr>

            <tr>
              <td class="entry" headers="d397987e117" data-title="Field Name"><span class="keyword parmname">previewType</span></td>

              <td class="entry" headers="d397987e120" data-title="Field Type">PreviewType (enumeration of type string)</td>

              <td class="entry" headers="d397987e123" data-title="Description">Specifies the format of previews of generated documents. Valid values are:<div class="p">
                  <ul class="ul bulletList">
                    <li class="li">
                      <samp class="codeph nolang">PDF</samp>—Displays how the generated
                      document looks in PDF format.
                    </li>

                    <li class="li">
                      <samp class="codeph nolang" id="InternalUsers-4D1EB2B9"><a name="InternalUsers-4D1EB2B9"><!-- --></a>Thumbnail</samp>—Displays a miniature representation of the
                      generated document.
                    </li>

                  </ul>

                </div>
                <p class="p">The default is <samp class="codeph nolang">PDF</samp>.</p>
              </td>

            </tr>

          </tbody>

        </table>

## Declarative Metadata Sample Definition

The following is an example of a DocumentGenerationSetting component.

<?xml version="1.0" encoding="UTF-8"?>
<DocumentGenerationSetting xmlns="http://soap.sforce.com/2021/10/metadata">
   <documentTemplateLibraryName>DocgenDocumentTemplateLibrary</documentTemplateLibraryName>
   <masterLabel>DocGen</masterLabel>
</DocumentGenerationSetting>

The following is an example package.xml that references the previous definition.

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2021/10/metadata">
    <types>
        <members>DocumentGeneration</members>
        <name>Settings</name>
    </types>
    <version>53.0</version>
</Package>

## Wildcard Support in the Manifest File

This metadata type doesn’t support the wildcard character \* (asterisk) in the package.xml manifest file. For information about using the manifest file, see [Deploying and Retrieving Metadata with the Zip File](https://developer.salesforce.com/docs/atlas.en-us.264.0.api_meta.meta/api_meta/file_based_zip_file.htm).