Hooks - Customer Doctype - updating records

Hi All,

I’m using hooks to fire specific functions when changes are made to Customer doctypes in ERPNext.
doc_events = { "Customer" : { "after_insert" : "my_api.create_customer", "after_save" : "my_api.update_customer" } }

after_insert works fine when a new customer is created. However, after_save is never called when I update an existing customer record. I’ve also tried on_update and on_update_after_submit without success.

Any ideas?

Thanks!

It seems that on_update did the trick - I just had to call bench clear-cache

1 Like

Also you can try to use “validate”