SCR_UsedStudyCredits_TDTM
Study Credits trigger handler/TDTM to prevent overuse by student and guest users
Table of Contents
Custom Permission | REDU - Student, REDU - Guest |
Event | AfterUpdate |
Object | Study Credits |
Related RIO Education Settings | None |
Description
Introduced in v3.14, this class prevents the overuse of Study Credits (beyond its available quantity) by students and guest users.
If a user:
-
has REDU - Student or REDU - Guest permission, and,
-
is increasing the Study Credit's ‘Used Quantity’ above its ‘Quantity’,
-
rio_ed__Study_Credit__r.rio_ed__Used_Quantity__c > rio_ed__Study_Credit__r.rio_ed__Quantity__c
-
rio_ed__Study_Credit__r.rio_ed__Used_Quantity__c > rio_ed__Study_Credit__r.rio_ed__Quantity__c
then, the class will prevent it.
Note:
It only checks if students and guest users are using more Study Credits than the available quantity.
It does not prevent the admin user from doing the same.
Use case
When a student or guest user places an order for a Study Offering, they will need to pay the amount of the Order Line.
Study Credits can be used as a “voucher” to offset the amount.
But if there are limited Study Credits available for usage, the users should not be able to use more than the available quantity.
See also: How Continuing Education works