# Managing Templates (Validation Management)

Validation Management has introduced template capabilities for _Test Protocols_ and _Test Scripts_ that, when enabled, allow users to create _Test Protocols_ and _Test Scripts_ from a _Template Test Protocol_ or _Template Test Script_ record, including test steps and additional prompts. This helps organizations develop and manage a standardized, approved repository of templates for creating _Test Protocols_ and _Test Scripts_.

Validation Management also has enhanced _Template Requirements_ for improved consistency and usability by utilizing the existing _Validation Requirement_ object and aligning with the paradigm for _Template Test Protocols_ and _Test Scripts_. By leveraging the _Validation Requirement_ object, _Template Requirements_ can now support versioning and Validation Teams. This change also introduces two new Admin settings that must be enabled to use this enhanced functionality and to migrate existing _Template Requirements_: the _Refactor Template Requirement_ setting and the _Migration Template Requirement_ setting.

<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>: The enhanced <em>Template Requirements</em> functionality is now automatically enabled with 25R3. Ensure that your <em>Template Requirement</em>-related configurations have been migrated accordingly.</p>
    </div>
  </div>
</div>



## Creating Template Requirements

Maintaining a set of _Template Requirements_ helps your organization establish an approved repository of _Template Requirements_ available for use in different types of entities. If configured by an Admin, you can import sets of _Template Requirements_ to a _Validation Entity_.

See [Managing Requirements](/en/lr/65904702/) for steps to import _Template Requirement Sets_ and create _Template Requirements_ when the _Refactor Template Requirement_ setting is not enabled.

### Creating Template Requirement Sets

To create a _Template Requirement Set_:

1. Navigate to **Business Admin** or a custom **Template Requirement Set** object tab.
2. Click **Create**.
3. Enter the required details.
4. Click **Save**.
5. In the _Template Requirement_ section, add or create _Template Requirements_.

### Creating Template Requirements

To create a _Template Requirement_ when the _Refactor Template Requirement_ setting is enabled:

1. Navigate to the _Template Entity_ that you want to add _Template Requirements_ to.
2. Navigate to the latest _Validation Entity Version_ for the _Template Entity_.
3. In your custom _Requirement Entity Version_ section, click **Create**. The default object type is associated with the _Create_ button.
4. Optional: Use the drop-down on the **Create** button to select a different record option based on your active object types.
5. Enter needed details such as the _Description_, _Requirement Category_, _Requirement Source_, _Requirement Source Details_, and _Requirement Suffix_.
6. Click **Save**.

To create a _Template Requirement_ when the _Refactor Template Requirement_ setting is disabled:

1. Navigate to **Business Admin** or a custom **Template Requirement** object tab.
2. Click **Create**.
3. Enter the required details.
4. Click **Save**.

## Creating Template Entities

Validation Template Managers can manage a library of templates for _Test Protocols_ and _Test Scripts_ that Test Authors in turn can use to create new _Test Protocols_ and _Test Scripts_. Before creating the _Template_-related records such as _Template Requirements_, _Template Test Protocols_, and _Template Test Scripts_, Template Managers must create _Template Entities_ to contain them.

### Creating a Template Entity

To create a _Template Entity_:

1. Navigate to the **Template Entities** tab.
2. Create a **Template Entity**.
3. Set the _Is Template?_ field to **Yes**, and complete the necessary fields for the _Template Entity_.
4. Click **Save**.

### Creating Template Activities

Validation Template Managers can manage a library of templates for commonly required validation deliverables, such as _Validation Plans_, _Risk Assessments_, _User Requirement Specifications_, _Design Specifications_, and _Validation Summary Reports_, which Validation Leads can then use to create new validation activities. 

Before creating the _Template Activities_, Template Managers must create _Template Entities_ to contain them.

To create a _Template Activity_:

  1. Navigate to the **Template Entities** tab.
  2. Click and open a **Template Entity** record.
  3. Under _Template Activities_, click **Create**.
  4. Complete the necessary fields for the _Template Activity_.
  5. Click **Save**.

After creating a _Template Activity_, you can add _Deliverables_:

  1. Click and open a **Template Activity** record.
  2. Under _Deliverables_, click **Create**.
  3. Complete the necessary fields for the _Deliverable_.
  4. Click **Save**.

Validation Template Managers can also add the **Create Activity From Source** [user action](/en/lr/43127/) to any state in the _Validation Entity Lifecycle_ (`val_inventory_lifecycle__v`) and _Validation Entity Version Lifecycle_ (`val_entity_lifecycle__v`). This action copies all child _Deliverables_, _Test Protocols_, _Test Scripts_, _Test Steps_, and additional prompts. Copying test protocols and test scripts leverages the existing deep copy services, allowing users and Validation Leads to create _Validation Activities_ from templates or existing _Validation Activities_. 

Vault notifies users when the _Create Activity From Source_ action completes. Validation Team Managers and Admins can modify [notification templates](/en/lr/2157/) as needed.

Users can perform the _Create Activity From Source_ action in bulk on a maximum of 5,000 records.

## Creating Test Protocols and Test Scripts

Validation Template Managers can add Validation Team Members to the team for a _Template Entity_ and then create a new _Test Script_ or _Test Protocol_ as a template for the _Template Entity_. Test Authors then can select the _Template Test Script_ or _Test Protocol_, perform the action to deep copy it, and select a target deliverable or create a new deliverable. Vault copies the selected _Test Script_ to the deliverable or _Test Protocol_ through a job and sends a notification when the process is complete.

### Creating Template Test Protocols

To create a _Template Test Protocol_:

1. Navigate to the _Template Entity_ that contains the _Template Test Protocols_.
2. Select the **Entity Version** that the _Template Test Protocol_ belongs to.
3. Create a **Template Test Protocol** in the _Template Test Protocol_ section.
4. Complete the necessary fields for the _Template Test Protocol_.
5. Click **Save**.

### Creating Template Test Scripts

To create a _Template Test Script_ that is not part of a _Template Test Protocol_:

1. Navigate to the _Template Entity_ that contains the _Template Test Protocols_.
2. Select the **Entity Version** that the _Template Test Script_ belongs to.
3. Create a **Template Test Script** in the _Template Test Script_ section.
4. Complete the necessary fields for the _Template Test Script_.
5. Click **Save**.

To create a _Template Test Script_ that is part of a _Template Test Protocol_:

1. Navigate to the _Template Test Protocol_ that contains the _Template Test Scripts_.
2. Create a **Template Test Script** from the _Test Script_ section.
3. Complete the necessary fields for the _Template Test Script_.
4. Click **Save**.

## Configuring Template Requirements

Before enhanced _Template Requirements_ can be used, Admins must enable the _Refactor Template Requirement_ setting from the **Admin > Settings > Application Settings** section under **Validation**.

Admins can configure the enhanced _Template Requirements_ capabilities by completing the following steps:

1. Configure the _Validation Req - Template Req Set_ object.
2. Enable the _Is Template?_ and _Template Requirement_ fields for all of the object types in the _Validation Requirement_ object.
3. Configure the _Available for Use_ lifecycle state with the appropriate entry criteria, entry actions, and user actions based on your business needs.
4. Add the _Import Template Requirement Set_ user action to the _Validation Entity Version_ object lifecycle for importing _Template Requirement Sets_.

## Migrating Existing Template Requirements

For organizations that use the legacy Template Requirement functionality, existing _Template Requirement_ records can be migrated to the _Validation Requirement_ object by enabling the _Migrate Template Requirement_ setting from the **Admin > Settings > Application Settings** section under **Validation**. If any missing records need to be migrated, this setting can be retoggled to migrate additional records.

Before migration begins, ensure that all _Template Requirement_ records are in the proper state. Vault can only migrate existing _Template Requirement_ records that are in states mapped to the _Initial_ state type and the _Available for Use_ state type. These records will be migrated to the matching states in the _Validation Requirement_ object lifecycle. Also ensure that the existing _Template Requirement_ field does not have _Criteria VQL_ configured to filter the state. As Vault migrates records in the _Initial_ state, the _Criteria VQL_ causes a failure.

### Migration Steps

Complete the following steps to migrate existing _Template Requirement_ records to the _Validation Requirement_ object:

1. Ensure that the _Migrate Template Requirement_ setting is enabled.
2. Once the migration job runs, ensure that you receive a notification that the migration is complete.
3. Confirm that Vault has created a _Validation Entity_ record called _Template Requirement Entity (Migrated)_ and that its type is _CSV_.
4. Ensure that all existing _Template Requirements_ in the _Initial_ state type and the _Available for Use_ state type have been migrated to this _Validation Entity_. This _Entity_ does not have an _Entity Version_. If you want to use new _Template Requirements_ in different _Template Entities_, update the _Validation Entity_ value to move and link to _Entity Versions_.
5. Confirm that the new _Template Requirements_ have the existing _Template Requirement_ value so that users can still see eSignatures.

## Configuring Template Test Protocols and Test Scripts

Admins can configure _Template Test Protocols_ and _Test Scripts_ by completing the following steps:

1. Enable the _Is Template?_ field for all of the object types for _Validation Entity_ and _Validation Entity Version_ objects.
2. Configure the Template Viewer role. Add the role to the _Validation Test Protocol_ and _Validation Test Script_ object lifecycles.
3. Update the page layouts for the _Validation Entity_, _Validation Entity Version_, _Test Protocol_, and _Test Script_.