Button function not working

Hi @lekhnath @NCP
This is my function but the view is like this can’t be editable. May I know the reason why?

frappe.ui.form.on(‘Annual Point Scheme’, {
refresh: function(frm) {
if (frm.doc.workflow_state === “Done”)
frm.add_custom_button(“Reset”, function() {
console.log(frm.doc.workflow_state,‘kkkkkk’);
cur_frm.set_value(“workflow_state”, “Draft”);

		},)
	}

});


This is my Application.

Reason 1:

Reason 2:


  1. First of all, if you don’t know the erpnext flow, look at the workflow.

  2. Once a transaction has been submitted, it cannot be returned. That transaction has to be canceled and renewed.

  3. No standard fields can be edited in the submitted transaction.


Thank You!