LR_ApprovedAttendance_TDTM
Leave Request trigger handler/TDTM
Custom Permission | REDU - Admin, REDU - Faculty, REDU - Student |
Event | AfterInsert, AfterUpdate |
Object |
Leave Request |
Related RIO Education Settings | None |
Description
Whenever a new Leave Request with a Status field value of Approved is inserted or if an existing Leave Request has its Status field updated to Approved, then this class will check if the Leave Request's Contact has any Attendances with Bookings that fall in between the Leave Request's starting date/time and ending date/time.
For any such Attendance records, if the Leave Request's Automatically Excuse Assignment field is checked, then the Excused field is checked and the Excused Reason is set to indicate that the reason was an excused Leave Request.
If the Automatically Excuse Assignment field is not checked, then this class will instead check the Revalidate Faculty Allocation field on the Attendance's related Session.
Use case
This is to automatically be excused from Attendance and fill in the Excused Reason.