On Submit hook on js side not working if workflow applied to document

We have one case where we want to use some code on submit of document on js side like

on_submit: function(frm) {
  // logic
}

It works perfectly fine if the document is simple and submittable, if we apply any workflow to a document where we have approved state and on approve we are submitting document but above trigger does not execute don’t know why

Hi @khushal_t,

Check its reference.


More details for check it.
Client-side hooks are here:
https://frappeframework.com/docs/v13/user/en/api/form#form-events

Server-side hooks are here:
https://frappeframework.com/docs/v14/user/en/basics/doctypes/controllers

Thank You!