![]() | Force-FrameworkMark Brennand |
| Description | Class defining the Trigger API available for public use. The Subscriber interface defines the contract that implementations must provide to process events generated by the Trigger API. Each Subscriber implementation must register itself with a Trigger metadata record. See README for full details of the Trigger API. Copyright (c) 2025 Mark Brennand, released under MIT License. |
|---|---|
| Author | Mark Brennand |
| Operation | global enum Operation The type of trigger operation that has fired. |
|---|
| Description | Disables the subscribers for the given object type. |
|---|---|
| Parameter | type: The object type whose subscribers are to be disabled. |
| Description | Disables the given Subscriber class. No further events will be published to the associated subscriber. |
|---|---|
| Parameter | type: The Subscriber class to disable. |
| Description | Enables the subscribers for the given object type. |
|---|---|
| Parameter | type: The object type whose subscribers are to be enabled. |
| Description | Enables the given Subscriber class. Events will be published to the associated subscriber. |
|---|---|
| Parameter | type: The Subscriber class to enable. |
| Description | Determines whether subscribers are enabled for the given object type. |
|---|---|
| Parameter | type: The object type whose subscription status is to be checked. |
| Returns | True if the subscribers are enabled. |
| Description | Determines whether the given Subscriber class is enabled. |
|---|---|
| Parameter | type: The Subscriber class to be checked. |
| Returns | True if the Subscriber class is enabled. |
| Description | Entry point for Trigger API. This method must be called from the Apex Trigger. An event representing the Trigger action is created and published to all the subscribers bound to the type of object associated with the Apex Trigger. |
|---|
| Description | Exception thrown when a trigger operation fails. |
|---|
| Description | Event created by the trigger to represent the operation being performed. The event is sent to all the Subscribers bound to the object. |
|---|
| Description | Gets the old value of a record. |
|---|---|
| Parameter | record: The record whose old value is required. |
| Returns | The old value of the record, or null if no old record found. |
| Description | Gets all the old values registered. |
|---|---|
| Returns | All the old values. |
| Description | Yields the trigger operation being performed. |
|---|---|
| Returns | The operation being performed by the trigger. |
| Description | Yields the records passed to the trigger for processing. Any records passed to an after trigger will have been cloned. This allows DML to be performed on them. |
|---|---|
| Returns | The records the trigger is processing. |
| Description | Yields the maximum recursive depth for the trigger. The recursive depth is the number of times the trigger has been called as a result of DML performed on the object associated with the trigger in trigger logic. If the recursive depth returned is 0, no checks on the recursive depth are performed. |
|---|---|
| Returns | The maximum recursive depth for the trigger. |
| Description | Checks whether given record has an old value assigned. |
|---|---|
| Parameter | record: The record whose old value is required. |
| Returns | True if the record has an old value. |
| Description | Indicates whether the trigger is performing an after action. |
|---|---|
| Returns | True if the trigger is performing an after action. |
| Description | Indicates whether the trigger is performing a before action. |
|---|---|
| Returns | True if the trigger is performing a before action. |
| Description | Classes implementing this interface may register themselves for use of the Trigger API. |
|---|
| Description | Method called by the Trigger API when a trigger fires. The event argument encapsulates all the information for the trigger operation that has fired. All the Subscriber implementations bound to the object whose trigger hss fired will have their onEvent method called. |
|---|---|
| Parameter | event: The trigger event. |