# About Batch Genealogy

During the batch disposition process, your organization may need to ensure that input batches used to produce a primary batch are approved for use and not impacted by quality events. Batch Release provides the option to generate a genealogy to accurately display relationships between batches in your Vault.

## Generating Batch Genealogy Records

The _Batch Genealogy_ object captures relationships between a primary batch and its related input batches and quality events. If configured by an Admin, users can initiate an action to generate reports on the _Batch Genealogy_ object, which automatically attaches a PDF of the report to a _Batch Disposition_ record.

Vault may create _Batch Genealogy_ records upon the creation of new _Batch_ _Dispositions_ and update them if a user creates or deletes a related batch. If configured by an Admin, users can also execute a user action to generate or recalculate a batch's genealogy.

### Automatic Removal of Genealogy Records

Vault has a weekly scheduled job to delete _Batch Genealogy_ records for batches with all their dispositions in the _Completed_ or _Cancelled_ state type.

### Limitations

Vault does not create _Batch Genealogy_ records for batches with more than 20 input batches and related batches with circular dependencies.

## Configuration Overview

Complete the following steps to allow users to utilize the batch genealogy feature:

  * Add the _Generate Genealogy Records_ field to the _Batch Disposition Plan_ object page layout and configure the field to _Show as checkbox_.
  * Ensure that the desired _Batch Disposition Plans_ have the _Generate Genealogy Records_ field selected. This option allows Vault to simultaneously create a _Batch Genealogy_ record upon creating a _Batch Disposition_ for a particular batch.
  * Configure a [user action to generate a _Batch Genealogy_][1] for a specific disposition's batch.
  * Configure the _Generate Document from Report_ user action on the _Batch Disposition Lifecycle_ to [generate a genealogy report][2].
  * Ensure the _Batch Release: Remove Batch Genealogy Records (Weekly)_ <a href="/en/gr/22897/#how-to-edit-job-definitions">job definition</a> is active.

## Configuring the Generate Batch Genealogy Action {#generate-genealogy}

Ensure that the **Generate Batch Genealogy** user action is configured on the _Batch Disposition Lifecycle_ in the desired lifecycle state. This action generates or recalculates a batch's genealogy. Vault notifies the user who executed the action when the operation is complete or has failed due to an error.

## Configuring the Generate Document From Report Action for Genealogy Reports {#generate-report}

The <a href="/en/gr/72016/#report-action">_Generate Document From Report_</a> action allows a user to create a document containing a batch genealogy report directly from a _Batch Disposition_ record. The newly generated document, in PDF form, is linked from the _Genealogy Report_ document reference field on the originating _Batch Disposition_ record. In order for users to have access to this function, you must [create a report][3] and make the _Generate Document From Report_ action available to users in the desired lifecycle states on the _Batch Disposition Lifecycle_.

### Creating a Report for Batch Genealogy {#create-report}

Before configuring the _Generate Document From Report_ action, you must select a compatible report type and create a report. The available report types for generating genealogy reports are _Batch with Batch Genealogy_, _Batch with Batch Disposition_, and _Batch with Quality Event_.


<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>: If your Vault utilizes <a href="/en/gr/722050/">standalone quality event objects</a>, the <em>Batch with Quality Event</em> report type is available for use with the <em>Deviation</em>, <em>Change Control</em>, <em>Lab Investigation</em>, and <em>Complaint</em> objects.</p>
    </div>
  </div>
</div>



## Related Permissions

Your permission set must provide _Read_ permission to the _Batch Genealogy_ (`batch_genealogy__v`) object in order for you to access _Batch Genealogy_ records.

  [1]: #generate-genealogy
  [2]: #generate-report
  [3]: #create-report