PREN_UpdatedPathway_TDTM
Program Enrollment update pathway trigger handler/TDTM
Custom Permission | REDU - Admin, REDU - Faculty, REDU - Student |
Event | AfterUpdate |
Object |
Program Enrollment |
Related RIO Education Settings | None |
Description
Whenever a Program Enrollment record with an in-progress Program Status has its Program Pathway field updated, this class will use the Recommended Credits per Term and Max Credits per Term on the new Program Pathway to update the Recommended Credits and Max Credits fields on any PE Pathways for that Program Enrollment that have either a Status field that is not Completed or an All Courses Completed? field that is false. The PE Pathways are also linked to the Program Pathway through the Program Pathway field.
If the Program Pathway has been changed from an older value (i.e. if the Program Pathway field was not null before the update), and the Program Pathway's Enrollment Method field is not Manual, then this class will raise an error.
If there are not enough existing PE Pathway records for the Program Pathways' Number of Terms, then new PE Pathways are created as necessary, with the My Term field being incremented as they are created, the Notes, Number of Terms, Study Mode, Recommended Credits and Max Credits fields being determined from the corresponding fields on the Program Pathway and the new PE Pathways being linked to both the triggering Program Enrollment and its related Program Pathway.
If the Program Pathway has been changed from an older value, then the Automatically Enroll in Courses and Term fields are also set. The Automatically Enroll in Courses field is set to true if the Program Pathway's Enrollment Method is 'Automatic all terms' or if the My Term field is 1 and the Program Pathway's Enrollment Method is 'Automatic by term/course'.
If the My Term field is 1, then the Term field is set to the Starting Term field value from the Program Enrollment record. If that field is not set, then it uses the Next Starting Term field from the Program Pathway's related Program Plan.
If the My Term field is not 1, then the Term is set based on previous Term hierarchy.
Use case
This is to automatically update the fields related to Program Pathway, in the event of changing Program Pathway on a Program Enrollment.