ORDL_CalculateAmount_TDTM
Order Line trigger handler/TDTM to calculate amount
Table of Contents
Custom Permission | None |
Event | BeforeInsert, BeforeUpdate |
Object | Order Line |
Related RIO Education Settings | None |
Description
Introduced in v3.14, this trigger handler is created against the Order Line object.
It will automatically calculate the ‘Amount’ field with the following formula: Amount = Quantity * Unit Price . This will automatically trigger every time the Quantity, Unit Price, or Amount is changed.
If the Order Line's ‘Quantity’ or ‘Unit Price’ fields are blank, it will throw an error to notify the user that these fields are required.
If the Order Line has a Study Credit linked in the lookup, the class will skip the Amount calculation and force it to be $0.
Use case
Order and Order Lines are created when a user registers for (buys) Study Offerings.
The amount that the user needs to pay will be calculated with this trigger.
For a Continuing Education use case, see here.