PRAP_CreateEnrollment_TDTM
Program Application create enrollment trigger handler/TDTM
Table of Contents
Custom Permission | REDU - Admin, REDU - Student |
Event | AfterInsert, AfterUpdate |
Object | Program Application |
Related RIO Education Settings | Auto Program Enrollment Enable PE Deletion From PA |
Description
Whenever a new Program Application with an approved Application Status is inserted, or whenever an existing Program Application has its Application Status field updated to an approved value, this class will create a Program Enrollment record if the Auto Program Enrollment custom setting is enabled.
If the related Program Plan's Support Pre-Acceptance Enrollment field is either 'Always' or 'For application fee only' (and the Application Fee on the Program Plan is not blank), the Program Enrollment will also be created if Application Status is submitted.
It will set the Program field on the new Program Enrollment based on the Program Application's Program field. If the Application Status was approved, it will set the Eligible to Enroll field to true and sets the Admission Date based on the Program Application's Status Date.
It will set the Program Status based on the Program Application's Status and, provided the Program Status is not withdrawn, will relate the Program Enrollment to the Program Application, set the Contact field based on the Program Application's Applicant, the Enrollment Status based on the Program Application's Study Mode and the Application Submitted Date based on the submitted date of the Program Application.
It will also set the Fee Type, Fee Type Option, Non-Tuition Fee Type, Non-Tuition Fee Type Option, Fee Method, Pay Upfront, Default Campus and Program Offering fields based on the corresponding Program Application fields.
It will set the Program Plan field based on the Program Application's Program Plan. If the Program Application does not have a related Program Plan, the default Program Plan for the Program will be used. The Starting Term will be set to the Program Application's Starting Term. If the Program Application's Starting Term is not set, it will use the Next Starting Term from the Program Plan.
Similarly, the Program Pathway will be set to either the Program Application's Program Pathway or the Default Program Pathway from the Program Plan.
If a Program Enrollment already exists for this Program Application, this class will update the existing one instead of creating a new one. When creating/updating the record, there is a validation to verify the Starting Term if one of the following conditions is met.
- The 'Support Pre-Acceptance Enrollment' field of the Program Plan != No
- Custom setting 'Enable PE Deletion From PA' = FALSE
Note: The above is exempted when withdrawing/cancelling the Program Application.
If the Program Enrollment's Term has finished, the following error will be thrown and the Program Enrollment will not be saved.
- Planned Starting Term has already ended. Please specify a new Starting Term.