# Configuring Country Dependencies (RIM)

Your organization can define country-to-country dependencies to support planned changes in your Vault. Country dependencies allow Vault to create _Activity Dependency_ records automatically each time an _Activity_ record is created. This ensures that users working at the country level are aware of dependencies for each country. See <a href="/en/gr/71821/ ">About Activity Dependencies</a> for more information.

<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>: This feature is only available on RIM Registrations Vaults.</p>
    </div>
  </div>
</div>



## Configuration Overview

Complete the following steps to configure your Vault to support country dependencies:

  1. Update the _Activity_ <a href="/en/gr/26387/">object page layout</a> to add a related object section for the _Activity Dependency_ object. This allows users to see the _Reference Activity_ records that Vault automatically creates when creating a new _Activity_ record. Include the **Section Help** text "Reference Activity for which this Activity is dependent on (e.g., Waiting for Approval of Activity)".
  2. Update the _Activity_ <a href="/en/gr/26387/ ">object page layout</a> to add a related object section for the _Activity Dependency_ object (second relationship) and apply the label "Dependent Activities". This allows users to see the _Dependency Activity_ records that Vault automatically creates when creating a new _Activity_ record. Include the **Section Help** text "Activity which are depending of this Activity (e.g. Activities which are waiting for Approval of this activity)".
  3. Optional: Update the _Event_ <a href="/en/gr/26387/ ">object page layout</a> to add the _Impacted Active Substance_ and _Impacted Manufacturing Site_ fields. Ensure the page layout also includes the _Impacted Product Family_ field. This step is only necessary if you want to use these fields when creating _Country Dependency_ records.
  4. On the _Activity_ <a href="/en/gr/30683/ ">object lifecycle</a>, add the _Waiting for Reference Country_ and _Reference Country Submitted/Approved_ states if they do not already exist.
  5. On the _Activity_ object lifecycle, add <a href="/en/gr/59885/#user-actions">user actions</a> to the _Reference Country Submitted/Approved_  state to progress records to the _Impact Identified_, _In Progress_, and _Planned_ states.
  6. On the _Activity_ object lifecycle, add <a href="/en/gr/59885/#user-actions">user actions</a> to the _Planned_ and _In Assessment_ states to progress records to the _Waiting for Reference Country_ state.
  7. On the _Activity_ object lifecycle, add <a href="/en/gr/59885/#entry_criteria">entry criteria</a> to the _Waiting for Reference Country_ state to validate that **State of Related Record > Activity Dependencies (Dependent Activity) > At least one record exists**.
  8. Create an _Activity Dependency_ <a href="/en/gr/30683/ ">object lifecycle</a> and assign it to the _Activity Dependency object_. Add  _Submitted_ and _Approved_ states to the lifecycle.
  9. On the _Activity_ object lifecycle's _In Progress_ state, add a _Change related object lifecycle state_ <a href="/en/gr/59885/#entry-actions">entry action</a> to move related _Activity Dependency_ (Reference Activity) records to the _Submitted_ state.
  10. On the _Activity_ object lifecycle's _Approved, Ready for Implementation_ state, add a _Change related object lifecycle state_ <a href="/en/gr/59885/#entry-actions">entry action</a> to move related _Activity Dependency_ (Reference Activity) records to the _Approved_ state.
  11. On the _Activity Dependency_ object lifecycle's _Submitted_ state, add an <a href="/en/gr/59885/#entry-actions">entry action</a> to **Perform with conditions**: If _Dependency Action_ equals _On Submission_ perform the action **Check sibling records before updating related record** to ensure **All sibling records are in lifecycle state** _Submitted_ or _Approved_ before updating the **Related Object** _Dependent Activity_ lifecycle state to _Reference Country Submitted/Approved_.
  12. Optional: Create a new <a href="/en/gr/2157/">object message</a> to notify users that the reference activity is complete. Add it as a _Send a notification_ <a href="/en/gr/59885/#entry-actions">entry action</a> on the _Activity Dependency_ object lifecycle's _Submitted_ state.
  13. On the _Activity Dependency_ object lifecycle's _Approved_ state, add an <a href="/en/gr/59885/#entry-actions">entry action</a> to **Perform with conditions**: If _Dependency Action_ equals _On Approval_ perform the action **Check sibling records before updating related record** to ensure **All sibling records are in lifecycle state** _Submitted_ or _Approved_ before updating the **Related Object** _Dependent Activity_ lifecycle state to _Reference Country Submitted/Approved_.
  14. On the _Country Dependency_ object lifecycle's _Active_ state (`active_state__c`), add a <a href="/en/gr/59885/#user-actions">user action</a> to change records to the _Inactive_ state (`inactive_state__c`). Additionally, for the _Inactive_ state, select the **Records in this state become inactive** <a href="/en/gr/30683/#define-states">checkbox</a>.
  15. Optional: Create a new <a href="/en/gr/2157/">object message</a> to notify users that the reference activity is complete. Add it as a _Send notification_ <a href="/en/gr/59885/#entry-actions">entry action</a> on the _Activity Dependency_ object lifecycle's _Submitted_ state.
  16. Update the _Event Object Type_ (`event_object_type__v`) <a href="/en/gr/1269/">picklist</a> with values corresponding to the object types of the _Event_ object, ensuring the **Picklist Value Name** matches the _Name_ of the corresponding object type. For example, the _Regulatory Event_ object type _Name_ is `regulatory_event__rim`, and so its corresponding picklist value name must be `regulatory_event__c`.
  17. <a id="non-labeling-event-config"></a>Optional: To support cross-functional _Events_:
  * Enable the **Rerun dependency checks when labeling impact is identified** <a href="/en/gr/53688/#rerun-dependency-checks">setting</a>.
  * Update the _Activity_ object page layout to include the _Local Labeling Impact_ field.
  * Create or update _Activity_ records with the appropriate _Local Labeling Impact_ field value.
  18. <a id="application-dependencies-config"></a>Optional: To support _Application_-level dependencies:
  * Enable the **Rerun dependency checks when labeling impact is identified** <a href="/en/gr/53688/#rerun-dependency-checks">setting</a>. This setting is already enabled if your Vault is also configured to support cross-functional _Events_ (Step 17).
  * Update the _Country Dependency_ and _Activity Dependency_ object page layouts to include the _Dependent Application_ and _Reference Application_ fields.
  * Create or update _Country Dependency_ records with the appropriate _Dependent Application_ and _Reference Application_ field values.

## Setting Up Country Dependencies

After your Vault is configured, you can set up _Country Dependency_ records as a master list of all country dependencies that impact your organization. You will create and define these records to fit your organization's business processes and the types of changes that may occur, such as a label change or a manufacturing change. When _Activity_ records are created, Vault matches all fields on the _Country Dependency_ records against the _Activity_ and _Event_ records to determine which _Activity Dependencies_ to create.

### How to Define a Country Dependency

To create a _Country Dependency_:

  1. Navigate to **Admin > Business Admin > Country Dependencies** and click **Create**.
  2. Select a **Reference Country**. This is the lead country for the dependency.
  3. Select a **Dependent Country**. This is the country to which the dependency rule applies.
  4. Select the **Applicable Product Type**. This is the type of product for which the dependency rule applies.
  5. Select the **Event Object Type**. This determines the _Event_ type for which Vault creates the _Activity Dependency_.
  6. Select the **Dependency Action**. This lets users working with _Activity Dependencies_ know whether the _Dependent Country_ must wait to take action until the _Reference Country_ submits changes or gets approval.
  7. Select the **Dependency Rule**. This lets users working with _Activity Dependencies_ know whether the dependency is optional or mandatory.
  8. Optional: Enter **Dependency Comments**. This informs users working with _Activity Dependencies_ about the dependency's rules.
  9. Optional: Select a **Product Family**, **Active Substance**, and/or **Manufacturer**. When any of these fields are populated on the _Event_ record related to an _Activity_, Vault uses the field to determine which _Activity Dependencies_ to create.
  10. Optional: Select a **Product**, **Product Variant**, and/or **Packaging** record as applicable. When any of these fields are populated on the _Registration_ object (_Product_, _Product Variant_) and _Registration Packaging_ object (Packaging), Vault uses them to determine which _Activity Dependencies_ to create.
  11. Optional: Select a **Dependent Application** and **Reference Application** record. When the _Dependent Application_ matches an _Activity_’s _Related Application_ field and an existing _Activity_ record’s _Related Application_ matches the dependency’s _Reference Application_, Vault creates an _Activity Dependency_ record with this value. Vault also sets the new record’s _Related Application_ field with the _Country Dependency_’s _Reference Application_.
  12. Click **Save**.

Repeat these steps for each _Country Dependency_ you want to create.

### Supporting Non-Labeling Events & Application-Level Dependencies {#non-labeling-event-overview}

To support cross-functional _Events_ where labeling impact is identified (for example, as the result of a manufacturing change control), Vault can create related _Activity Dependency_ records based on the _Country Dependency_ records you’ve defined with a Labeling _Event Object Type_.

Once [enabled][1], Vault checks for dependencies based on the _Local Labeling Impact_ field value of any related _Activities_ for the cross-functional event. When a user sets this field to _Yes_, Vault assesses existing _Country Dependency_ rules (with the Labeling _Event Object Type_) and creates the applicable _Activity Dependency_ records.

If your Vault’s _Country Dependency_ records are also [configured][2] to track a _Reference Application_ and _Dependent Application_, Vault creates _Activity Dependency_ records where:
  * The referenced activity matches the _Dependent Activity_.
  * The activity’s _Related Application_ is the _Dependent Application_.
  * An existing _Activity_ for the Event has a _Related Application_ that matches the _Reference Application_.

This can be useful for managing _Application_-level dependencies across different markets, within the same market, and within the same _Application_.


<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>: During <a href="/en/gr/50545/">splitting</a>, Vault sets the field on target <em>Activity</em> records with the same <em>Local Labeling Impact</em> value as the source <em>Activity</em> record, and does not display the field in the wizard. To capture a value for the <em>Local Labeling Impact</em>, allow Vault to create the target <em>Activity</em> record, then edit and re-save the new record with the desired <em>Local Labeling Impact</em>.</p>
    </div>
  </div>
</div>



[1]: #non-labeling-event-config
[2]: #application-dependencies-config
