SELF_REFERENCE_FROM_TRIGGER error from Apex Triggers
|Knowledge Article Number||000005278|
|Resolution||Apex throwing the error, SELF_REFERENCE_FROM_TRIGGER indicates that you’re attempting to update or delete a record that is already being updated by another trigger.
Direct operations that cause Apex error
1. A trigger performs a DML operation that attempts to update a record that’s already being updated by another trigger. Read more about DML operations in our Developer Documentation.
2. Apex trigger causes a DML event to run on a record already involved in an identical DML event.
Example of indirect operation that causes Apex error
The Apex error you’re receiving can also be caused by an indirect operation requesting conflicting updates. Here’s an example of an indirect operation that can trigger the error message.
1. Request submitted to update Object A.
2. A before update trigger on Object A creates an Object B.
3. Object A is updated.
4. An after insert trigger on Object B queries Object A and updates it.
This is an indirect update of Object A because of the before trigger of Object A, so an error will be generated.
Read our Developer Documentation about Core Data Types Used in API to find out more information on potential error messages you can encounter with Apex.