SOBJ_DeleteValidation_TDTM
Plan Requirement delete validation trigger handler/TDTM
Table of Contents
Custom Permission | REDU - Admin, REDU - Faculty, REDU - Student |
Event | BeforeDelete |
Object | Plan Requirement |
Related RIO Education Settings | None |
Description
This class prevents a record from being deleted, if it is being referenced by any child records, provided the child record is not the same object as the parent and the "What to do if the lookup record is deleted?" option is set to "Clear the value of this field".
Note: As of v3.14, Master-Detail relationships are excluded from the delete validation. In other words, if the child record is a Detail, then, the user will be allowed to delete the parent record (Master).
By default, this trigger is enabled only on the Plan Requirement object. However, it can also be enabled for other objects by creating a Trigger Handler record as follows:
- Name = Any name
- Class = rio_ed.SOBJ_DeleteValidation_TDTM
- Load Order = 1 (or any that is suitable)
- Object = object API name
- Trigger Action = BeforeDelete
- User Managed = checked
- Active = checked
Use case
Plan Requirements are used to layout the structure of a Program Plan. A Course Plan Requirement is the record of a Course that a student needs to take for a Program. Multiple Course Plan Requirements can be grouped under a Group Plan Requirement.
This class will prevent the user from deleting the Group Plan Requirement, since all the child records under it (Course Plan Requirements) are parked under it.