AnsweredAssumed Answered

Issue with after_relationship_delete hook for Cases module in 7.6

Question asked by Varun Nath A V on Apr 8, 2016

I have a one to many relationship from a "Custom Module" to "Cases" module. So there is a relate field for this custom module in Cases and a Subpanel for Cases in the Custom Module. When a linked record is un-linked from the Custom Module I need to update the status of the Case. So added an "after_relationship_delete" hook in "Cases" to update the status. But this hook will execute for the following scenario also:


- Case is already linked to a record in the Custom module

- Replaced the linked record with a new one


But in this case the status should not be updated as actually we are not unlinking, only replacing the old one with a new one. I believe the issue is that in this scenario "after_relationship_delete" hook executes first and then only "after_relationship_add" hook will get executed. So the status of the Cases will be updated. Does anyone came across this issue?


I am using sugarCRM 7.6