# Enable Partner Distribution Tracking and Generate Final Aggregate Report ZIP

Learn how to configure your Vault to specify Aggregate Report Destination types and generate compiled ZIP files of aggregate reports.

## About the Feature

With the 24R2 release, SafetyDocs supports new object types to specify whether an Aggregate Report Destination is a Health Authority Submission or a Partner Distribution. Additionally, users can now generate ZIP files of authored aggregate reports to download for easy distribution.

For information on specifying Aggregate Report Destination object types and generating final ZIP files, see <a href="/en/gr/680414/">Author Aggregate Reports</a>.

## Update Fields

Go to **Admin > Configuration > Objects > Aggregate Report Destination > Fields** and make the updates outlined in the following sections.

### Update the Health Authority Field

Complete the following steps to update the label of the **Health Authority** field to reflect its purpose more accurately:

1. On the **Fields** page, select **Health Authority**.
2. Select **Edit**.
3. In the **Label** field, enter "Destination Organization".
4. Select **Save**.

### Update the Name Field

Complete the following steps to update the **Name** field to align with the new label of the **Health Authority** field:

1. On the **Fields** page, select **Name**.
2. Select **Edit**.
3. Update the **Help Content** field as necessary to reflect the changed label. 
4. In the **Value Format** field, enter `{health_authority__vr.name__v}-{####}`.
5. Select **Save**.

## Configure Object Types

The following sections outline how to update the **Aggregate Report Destination** object's object types.

### Update Default Object Type

Complete the following steps to update this object's default object type:

1. Go to **Admin > Configuration > Objects > Aggregate Report Destination > Details**.
2. Select **Edit**.
3. In the **Default Object Type** field, select **Health Authority Submission**.
4. Select **Save**.

### Make Base Object Type Inactive

Complete the following steps to make the **Base** object type inactive:

1. Go to **Admin > Configuration > Objects > Aggregate Report Destination > Object Types**.
2. Select **Base Aggregate Report Destination**.
3. Select **Edit**.
4. In the **Status** field, select **Inactive**.
5. Select **Save**.

### Add Field VQL

Complete the following steps to add **Criteria VQL** to the **Destination Organization** field on the applicable object types:

1. On the **Object Types** tab, select **Health Authority Submission**.
2. Select the **Destination Organization** field.
3. Select **Edit**.
4. In the **Criteria VQL** field, enter `object_type__vr.api_name__v = 'agency__v'`.
5. Select **Save**.
6. Return to the **Object Types** tab and select **Partner Distribution**.
7. Select **Edit**.
8. In the **Criteria VQL** field, enter `object_type__vr.api_name__v = 'partner__v'`.
9. Select **Save**.

### Delete Field from Partner Distribution Object Type

On the **Partner Distribution** page, select the **Applicable Market** field, and then select **Delete**. In the **Deleting "Applicable Market"** dialog, select **Continue**.

## Configure the Aggregate Report Destination Layout

Complete the following steps to configure this layout:

1. Go to **Admin > Configuration > Objects > Aggregate Report Destination > Layouts > Aggregate Report Destination Detail Page Layout**.
2. In the **Details** section, add the following fields:
    * **Aggregate Report Destination Type**
    * **Masked**
    * **PV Agreement**
    * **PVA Activity Type**
3. Select **Save**.

## Configure Object Lifecycle

Go to **Admin > Configuration > Object Lifecycles > Aggregate Report Destination Lifecycle** and complete the steps outlined in the following sections.

### Update User Action on the Submitted State

Complete the following steps to update a user action on the **Submitted** state so that only **Health Authority Submission** type Destinations can reach the **HA Received** state:

1. In the **States** section, select **Submitted**.
2. In the **User Actions** section, select **Edit**.
3. Update the **Always Change State to: HA Received** user action to the following:
    * **Perform with conditions >**
        * If > **Aggregate Report Destination Type > equals > Health Authority Submission**
    * Allow the following actions:
        * **Change State to > HA Received**
            * **Action Label**: "Change State to HA Received"
        * **Change State to > Deferred**
            * **Action Label**: "Change State to Deferred"
4. Select **Save**.

### Add User Action on the Complete State

Complete the following steps to add the **Generate Final Aggregate Report ZIP** action on the **Complete** state:

1. In the **States** section, select **Complete**.
2. In the **User Actions** section, select **Edit**.
3. Select **Create Rule** and create the following rule:
    * **Always >**
    * Allow the following actions:
        * **Generate Final Aggregate Report ZIP**
        * **Action Label**: "Generate Final Aggregate Report ZIP"
4. Select **Save**.

## Update Permission Sets

Go to **Admin > Users & Groups > Permission Sets** and complete the steps in the following sections to update various permission sets in your Vault:

### Administration Actions

Complete the following steps to update this permission set:

1. Go to the **Administration Actions** permission set.
2. In the **Objects** tab, select **Edit**.
3. Select the applicable checkboxes to grant **Read** permissions on all object types of the **Aggregate Report Destination** object.
4. Select **Save**.

### Aggregate Report Writer

Complete the following steps to update this permission set:

1. Go to the **Aggregate Report Writer** permission set.
2. In the **Objects** tab, select **Edit**.
3. Select the applicable checkboxes to grant **Read**, **Create**, **Edit**, and **Delete** permissions on all object types of the **Aggregate Report Destination** object.
4. Select **Save**.

### Safety Operations Actions

Complete the following steps to update this permission set:

1. Go to the **Safety Operations Actions** permission set.
2. In the **Objects** tab, select **Edit**.
3. Select the applicable checkboxes to grant **Read**, **Create**, **Edit**, and **Delete** permissions on all object types of the **Aggregate Report Destination** object.
4. Select **Save**.

