On_trash hook when delete from list

I want hook when any records are deleted from list in my newdoctype. I have tryed on_trash but it is called when record is deleted from menu->delete.


on_trash event will also work when you delete the document from List view of Form View.


Hey, @makarand_b
You are right and its working fine but i have an other issue also, that if after on_trash called, the item does not deleted because it is connected to some where else then how to validate the delte event before the on trash called. ?

Did you find an answer to this?

Not sure when it was added but we now have an after_delete hook that should work for this:

Method Name Description
after_delete This is called after a document has been deleted.