I have a workflow defined, now when I click on “Approve” I want to give a frappe.confirm dialog box and if the user clicks the “Yes” then the doc should be approved, if “No” is clicked then the workflow state should remain unchanged.
I have tried do in the following way from the client side-
But I couldn’t figure out to stop the change of the workflow, frappe.validated = false doesn’t work
Can someone suggest a way here? Thank You.
I want to add a confirmation dialogue box for my workflow. Please tell me where do I need to add the code? I have added the following custom script for my doctype.
here you need to add the trigger i.e. before_workflow_action: async (frm) => { ....
Check out my code above that’s how I used it.
And finally you need to add this line await promise.catch((err) => frappe.throw(err));
If you want to throw some error then add anything in the brackets of reject like reject("You can't Calibrate at this state")