# Configuring Dynamic Enrollment

The Dynamic Enrollment feature allows Vault to automatically assign _Learner Roles_ to a _Person_, based on structured data available on the _Person_ and _Learner Role_ records. You can select matching fields between _Person_ and _Learner Role_ (such as _Department_) to drive _Learner Role_ assignment. Additionally, if _Person_ metadata changes, this feature also automatically removes _Learner Roles_ and assigns any newly appropriate _Learner Roles_.

For example, if a _Person_ has a _Department_ value of Quality Assurance, Vault would automatically give them the _Learner Role_: _Quality Assurance Core_. If that _Person_ then switches to a new department, _Validation_, then Vault would remove the _Quality Assurance Core_ _Learner Role_ and may assign a new _Validation Executor Core_ _Learner Role_, depending on _Person_'s new _Department_.



<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 available for Veeva Training only.</p>
    </div>
  </div>
</div>



## Configuration Overview

A Vault Admin must complete the below steps to enable Dynamic Enrollment in your training matrix. Once configured, a Vault Admin [creates][1] Dynamic Enrollment Rules, then a Training Admin can [add][2] the feature to individual _Learner Role_ records.

1. Activate the following object types:
    * Within the _Learner Role-Person_ object, activate the _Learner Role-Person_ object type (`learner_role_person__v`)
    * Within the _Learner Role_ object, activate the  _Learner Role_ object type (`learner_role__v`)
2. Add the _Delete Dynamic Enrollment Person Joins_ object action to the _Learner Role_ object. During configuration, do not check the _Available in All Lifecycle States_ option.
3. Add the _Delete Dynamic Enrollment Person Joins_ action as a user action in the following _Learner Role_ object lifecycle states:
    * _Initiated_ (`in_progress_state__v`)
    * _Ready for Use_ (`eligible_state__v`)
4. Add the below components to the _Learner Role_ object page layout. When adding the application control and impact alerts, you can additionally configure the **Specify different Label and Help Content** option. 
    * _Allow Dynamic Enrollment?_ field
    * _Dynamic Enrollment Configuration_ application control field
    * _Impact Alert: Update Allow Dynamic Enrollment_
    * _Impact Alert: Update Dynamic Enrollment Configuration_
5. Review your Vault's security configuration and confirm Training Admins are assigned the appropriate [permissions][4].
6. Activate the _Dynamic Enrollment Evaluation_ job.

## Creating Dynamic Enrollment Rules {#creating-dynamic-enrollment-rules}

To create a _Dynamic Enrollment Rule_:

  1. Navigate to **Admin > Configuration > Dynamic Enrollment Rules**.
  2. Click **Create**.
  3. Fill in the required fields, including a **Name** and **Label**.
  4. In the **Matching Type** drop-down, select **EXACT**.
  5. Click **Save**.
  6. In the _Dynamic Enrollment Matching Fields_ section, click **Create**.
  7. Fill in the required fields, including a **Name** and **Label**.
  8. In the **Person Object** field, select the **Person** object.
  9. In the **Person Field** box, fill in an object or picklist field name in the following format: `Field.[name]`, for example, `Field.department__c`. **Note**: Dynamic Enrollment currently supports object and picklist field types only. Other types, including lookup fields, are not supported.
  10. In the **Learner Role Object** field, select the **Learner Role** object.
  11. In the **Learner Role Field** box, fill in an object or picklist field name in the following format: `Field.[name]`, for example, `Field.department__c`.
  12. Click **Save**.

While you can have an unlimited number of fields per rule, the matching fields are evaluated with an AND operator. For example, if you configured matching fields for _Title_ and _Department_, the _Person_ record would need to match values in both of these fields with the _Learner Role_ to be assigned. Dynamic Enrollment also considers null (blank) field values to be specific, rather than "any" values, and will match them with corresponding null field values on the other object. You cannot update a _Dynamic Enrollment Rule_ if it is used on a _Learner Role_.

## Adding Dynamic Enrollment to Learner Roles {#adding-dynamic-enrollment-to-learner-roles}

A Training Admin can enable Dynamic Enrollment by selecting the **Allow Dynamic Enrollment?** checkbox on the applicable _Learner Role_, then selecting a value for **Dynamic Enrollment**. When the _Dynamic Enrollment Evaluation Job_ runs, Vault checks for the defined matching fields and only assigns _Learner Roles_ to the Learner to which the values correspond. Changing the _Dynamic Enrollment Configuration_ value on a Learner Role record will cause warnings of its potential impact.

Dynamic Enrollment cannot be used with _Learner Roles_ of object types _Individual_ or _Study_{:#training-limit-11}.

### Assign to All {#assign-to-all}

You can select a _Dynamic Enrollment Configuration_ of _Assign to All_ to cause every Learner to be assigned this _Learner Role_. Up to 15 _Learner Roles_ may have the _Assign to All_ value at any given time.

## Record Change Behavior

While Dynamic Enrollment's basic behavior is outlined above, the _Dynamic Enrollment Evaluation Job_ will additionally react to changes in _Person_ or _Learner Role_ records in the following ways:

  * Dynamic Enrollment will never remove a _Learner Role_ from a _Person_ if that association was created manually. It will only act on _Learner Roles_ that were assigned through Dynamic Enrollment.
  * If a _Person_ who previously matched a _Learner Role_ no longer matches, due to changes in their matching field values, that _Learner Role_ will automatically be removed. That _Person_ will then be evaluated with their new value to see if they match other _Learner Roles_.
  * If data on a _Learner Role_'s matching fields changes, any _Persons_ who no longer match will be removed and the _Learner Role_ will be evaluated against all other _Persons_ to find new matches.
  * Changing the _Dynamic Enrollment Configuration_ value causes the _Learner Role_ to be re-evaluated, and all current associations that were created based on the previous configuration are eligible for removal if they no longer result in matches.

The _Dynamic Enrollment Evaluation Job_ will additionally react to the following less common changes:

  * If a _Person_ is made _Ineligible_:
    * _Learner Roles_ assigned via Dynamic Enrollment are not removed.
    * The _Person_ is no longer evaluated for Dynamic Enrollment.
  * If a _Person_ is made _Eligible_:
    * The _Person_'s existing _Learner Roles_ are evaluated to make sure they're still true. Any that no longer match are removed.
    * The _Person_ is evaluated against all other _Learner Roles_ to see if any new associations should be made.
  * If a _Learner Role_ is _Retired_:
    * _Learner Roles_ assigned via Dynamic Enrollment are not removed.
    * The _Learner Role_ is no longer evaluated for Dynamic Enrollment.
  * If **Allow Dynamic Enrollment?** is deselected on a _Learner Role_:
    * _Learner Roles_ assigned via Dynamic Enrollment are not removed. If you want these to be removed, use the **Delete Dynamic Enrollment Person Joins** user action.
    * The _Learner Role_ is no longer evaluated for Dynamic Enrollment.
  * If a _Person_ record is updated such that matching fields no longer apply, or eligibility is changed from _Ineligible_ to _Eligible_:
    * Retired _Learner Roles_ assigned via Dynamic Enrollment are removed.
    * Learner Role records where **Allow Dynamic Enrollment?** is deselected are not removed.

## Removing Learner Roles Assigned via Dynamic Enrollment

By default, Learner Roles assigned to Person through Dynamic Enrollment cannot be manually removed. However, the **Delete Dynamic Enrollment Person Joins** user action is configurable in the _Learner Role Lifecycle_. If you need to remove _Learner Roles_ from _Persons_ which has been assigned via Dynamic Enrollment, you can only do so via this action. This removes all auto-created associations for the _Learner Role_ and cannot target a specific Learner.

## Related Permissions {#related-permissions}

To work with Dynamic Enrollment, Training Admins must be assigned a [permission set](/en/lr/23647/) with the below permissions. Otherwise, Training Admins can only select the [_Assign to All_][3] Dynamic Enrollment Configuration option on a _Learner Role_ record.

| Permission Label | Permissions |
| - | - |
| Admin: Configuration: Dynamic Enrollment Rules | Read, Create, Edit, Delete |

[1]: #creating-dynamic-enrollment-rules
[2]: #adding-dynamic-enrollment-to-learner-roles
[3]: #assign-to-all
[4]: #related-permissions
