I have created a trigger that inserts a record into an object that has a master detail relationship to the Standard Order object. When this record is updated the products are updated as well as I use a Lookup Related Engine to extend the Roll Up Summary functionality (essentially stock control by decreasing a value in a custom field). This all works as expected. The order in question is already activated.
The problem is that our After Update Trigger of our Order Object is being executed and I can't determine why.
If I filter the debug log it states the following:
- CODE_UNIT_STARTED Inventory Trigger AfterInsert
- CODE_UNIT_FINISHED Inventory Trigger AfterInsert
- CODE_UNIT_STARTED [EXTERNAL] Validation: Order: ID
- CODE_UNIT_FINISHED Validation: Order: ID
- CODE_UNIT_STARTED Order Trigger AfterInsert
It is the triggering of the Order AfterInsert I don't understand. I am also a little unsure as to the relevance/importance of the " EXTERNAL Validation" reference in the log.
I would like a bit better understanding of the execution order, my current best guess is the LR Engine is updating the products quantity field and this is causing the order to think it is updated (there are no triggers on the product object and the orderlineitem triggers aren't executed).