In crm i have solution with several entities. There are three that are causing a problem. Lets call them A, B and C.
A and B have a one to many relation with a cascading effect on deletion
B and C have a one to many relation without a cascading delete.
for B i have developed a crm plugin that, when deleted, it removes C as well. A sort of cascading delete plugin. I cannot create a cascading between B and C, since C is already in a cascading relationship with another entity.
When i delete any entity B, it fires off plugin code and deletes all children of C. When i delete any entity A, it cascade deletes B, but it does not fire off the plugin.
How can i ensure that the plugin does fire, without creating a plugin for entity A? I am fairly new at crm so i don't really know where to look for this kind of problem.
UPDATE
The plugin used to fire at the 'Pre-validation' stage. Changing it to 'Pre-operation' actually caused the plugin to fire. Unfortunately at this stage all Child references of the object where already removed. So now when A is deleted B is cascade deleted, and the plugin fires, but i cannot find any of it's child entity C references