Contents
What causes self reference from trigger in apex?
So when you delete the OpportunityLineItemSchedule records you are effectively updating the OpportunityLineItem, which causes the SELF_REFERENCE_FROM_TRIGGER DML Exception. See the Effects on Opportunities and Opportunity Line Items section of the OpportunityLineItemSchedule documentation.
What was the first error in self reference from trigger?
First exception on row 0 with id 500Q0000002FHIoIAO; first error: SELF_REFERENCE_FROM_TRIGGER, Object (id = 500Q0000002FHIo) is currently in trigger RecordType_Change, therefore it cannot recursively update itself: [] Trigger.RecordType_Change: line 12, column 16: []
Do you need a before update trigger in Salesforce?
In fact there is no need to do that, as you can simply make changes to it and these will be saved to the database when the transaction commits. A before update trigger allows you to make further changes before the record is committed to the database. I made the chages. But still it is giving me the same issue.
What causes self reference from trigger DML error?
When using revenue schedules the TotalPrice on the parent OpportunityLineItem is updated based on the associated OpportunityLineItemSchedules. So when you delete the OpportunityLineItemSchedule records you are effectively updating the OpportunityLineItem, which causes the SELF_REFERENCE_FROM_TRIGGER DML Exception.
How to solve cannot insert update entity maximum trigger?
Create a apex class with global or public access specifier and call the apex class inside the trigger in an IF statement. This will check to see, if the static variables inside the apex class meets the specified conditions. In the trigger, never forget to add the IF check, which is called from the instance of the above class.
How to write maximum trigger in apex class?
This will check to see, if the static variables inside the apex class meets the specified conditions. In the trigger, never forget to add the IF check, which is called from the instance of the above class. Writing our trigger in this manner, avoids recursive firing of triggers.