# Configuring Automatic Dossier Document Creation from Templates (Registration & Dossier Management)

<a href="/en/gr/71498/">Registration & Dossier Management</a> provides users with the ability to <a href="/en/gr/679926/">automatically create documents from templates for a dossier</a> before generating a <a href="/en/gr/76894/">Dossier Binder</a>. You can create the applicable controlled document templates, which users can then select on the <a href="/en/gr/71505/">generated _Requirements_</a> for which they want to create documents. When users run the _Auto create document from template_ action, Vault generates documents from the user-specified templates for the appropriate descendant _EDL Items_ in the dossier or all dossiers associated with an _Event_.

## Configuration Overview {#overview}

Configuring your Vault to create dossier documents from templates involves the following steps:

1. [Configure and create controlled document templates][1]
2. [Configure the _Requirement_ object layout][2]
3. Optional: [Configure default field values][3]
4. [Configure the _Auto create document from template_ action][4]
5. Optional: [Configure dynamic document auto-naming][5]
6. [Configure user permissions][6]

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: Depending on your Vault’s creation date and which features are currently enabled and configured, some of the steps described in this article may be unavailable or already complete in your Vault.</p>
    </div>
  </div>
</div>



## Configuring & Creating Controlled Document Templates {#templates}

Controlled document templates allow users to create templates using regular Vault documents as the template source file. You must configure and then create the applicable controlled document templates from which Vault will create documents with the _Auto create document from template_ action. Users will select one (1) of these templates in the _Document Template_ field on _Requirement_ records for which they want to generate matched documents for descendent _EDL Items_.

Ensure the controlled document templates you create meet the following criteria:

* They are in the latest <a href="/en/gr/14560/">steady state version</a>.
* The _Template Document Type_ field must have a value. 

See the following articles for more details about configuring, creating, and managing controlled document templates:

* <a href="/en/gr/46025/">Configuring Controlled Document Templates</a>
* <a href="/en/gr/46018/">Creating & Managing Controlled Document Templates</a>
* <a href="/en/gr/5509/#create-controlled-template">Managing Document Templates</a>

## Configuring the Requirement Object Layout {#object-layout}

You must add the following fields to the _Requirement_ <a href="/en/gr/26387/">object layout</a>:

* _Document Lifecycle Name_ (`document_lifecycle__v`)
* _Document Template_ (`document_template__v`)

## Configuring Default Field Values {#default-values}

Before users can run the _Auto create document from template_ action, they must populate certain fields on the _EDL Items_ and parent _Requirements_ with the appropriate values. You can leverage Object Mappings to automatically populate these fields with <a href="/en/gr/74401/#default-field-values">default values</a> when users generate records using the _Generate Requirements_ and _Update Requirements_ actions. If you do not configure default values, users must populate the following required fields on the records for which they want to create documents before running the _Auto create document from template_ action:

<table>
  <tr>
        <th><strong>Object</strong></th>
        <th><strong>Field</strong></th>
        <th><strong>Field Value</strong></th>
   </tr>
    <tr>
        <td><em>Requirement</em></td>
        <td><em>Document Lifecycle Name</em> (<code>document_lifecycle__v</code>)</td>
        <td><ul><li>If this value is blank, the <em>Full Document Type</em> field of the descendant <em>EDL Item</em> must reference a document type with one (1) lifecycle.</li>
<li>If this value is populated, the <em>Full Document Type</em> field of the descendant <em>EDL Item</em> must have the same value.</li></ul></td>
    </tr>
    <tr>
        <td><em>Requirement</em></td>
        <td><em>Document Template</em> (<code>document_template__v</code>)</td>
        <td><ul><li>Value defines which template Vault uses to create the dossier document for the applicable descendant <em>EDL Items</em>.</li>
<li>Value must reference a <a href="#templates">controlled document template</a>.</li></ul></td>
   </tr>
    <tr>
        <td><em>EDL Item</em></td>
        <td><em>Full Document Type</em> (<code>doc_type_details__v</code>)</td>
        <td><ul><li>Value must be the same as the <em>Template Document Type</em> field value of the document specified by the user in the <em>Document Template</em> field on the grandparent <em>Requirement</em>.</li>
<li>Value is dependent on the <em>Document Lifecycle Name</em> field value of the grandparent <em>Requirement</em>.</li></ul></td>
   </tr>
</table>

## Configuring the Auto Create Document from Template Action {#action}

Depending on your business needs, you can assign the _Auto create document from template_ action to the _Requirement_ and _Event_ objects and configure it in the following ways:

* Add this action as an <a href="/en/gr/59885/#entry-actions">entry action</a> on any _Requirement_ or _Event_ lifecycle state. 
* Add this action as a <a href="/en/gr/59885/#user-actions">user action</a> on any _Requirement_ or _Event_ lifecycle state.

We recommend adding this action to the _In Progress_ lifecycle state. When configuring this action on the _Requirement_ object, we recommend configuring it to <a href="/en/gr/59885/#conditions">perform conditionally</a> when the _Parent Requirement_ field is blank so that users can only execute it on root records. We do not recommend configuring the action on the _Initial State_ lifecycle state type.

### Limitations {#actio-limitations}

The following limitations apply to the _Auto create document from template_ action:

* Vault does not apply any <a href="/en/gr/618/#settings-at-all-levels">default Sharing Settings</a> you've configured for the document type. We recommend configuring <a href="/en/gr/31824/">DAC</a> to control user access to uploaded documents.
* Vault does not enforce requiredness for any <a href="/en/gr/2617/">document field dependencies</a> you've configured.

## Configuring Dynamic Document Auto-Naming {#auto-naming}

You can configure <a href="/en/gr/18753/">document name defaulting</a> for the applicable document types to specify how Vault names documents generated by the _Auto create document from template_ action. If you do not configure automatic naming, Vault names generated documents the same name as the _Requirement_ for which the document is created.

## Configuring User Permissions {#user-permissions}
You must ensure users have the appropriate read and create <a href="/en/gr/22824/">permissions</a> to access the appropriate objects and object fields in addition to the permissions outlined below:

* _Read_ permission on the _Requirement_, _Registration Requirement_, and _Registration_ objects.
* _Edit_ permission on the _EDL Item_ object.

## Related Permissions {#related-permissions}

You can complete all the steps in this article with the standard _System Administrator_ or _Vault Owner_ security profile. If your Vault uses custom security profiles, your profile must grant the following <a href="/en/gr/22824/">permissions</a>:

<table>
  <tr>
    <th><strong>Type</strong></th>
    <th><strong>Permission</strong></th>
    <th><strong>Controls</strong></th>
  </tr>
  <tr>
    <td>Security Profile</td>
    <td>Admin: Configuration: Object Lifecycles: Create, Edit</td>
    <td>Ability to create and modify object lifecycles.</td>
  </tr>
    <tr>
    <td>Security Profile</td>
    <td>Admin: Configuration: Objects: Create, Edit</td>
    <td>Ability to create and modify Vault objects.</td>
  </tr>
  <tr>
    <td>Security Profile</td>
    <td>Admin: Security: Permission Sets: Edit</td>
    <td>Ability to modify permission sets for users.</td>
  </tr>
</table>

[1]: #templates
[2]: #object-layout
[3]: #default-values
[4]: #action
[5]: #auto-naming
[6]: #user-permissions
