Try ERPNext Buy Support Partners Foundation

Need a Custom script in sales order to change to workflow state Review after update button is clicked

I wanted to write a custom script in Sales Order page to change the workflow state to Review after update button is clicked.

Please anyone help me

try
cur_frm.set_value("workflow_state", "Review");

Source: Some customs scripts that I use

frappe.ui.form.on(‘Sales Order’, {
on_update(frm) {
cur_frm.set_value(“workflow_state”, “Review”);
}
})

Can you please help me? whether this is correct?

frappe.ui.form.on('Sales Order', {
    MY_BUTTON_NAME: function(frm) {
        frm.set_value(“workflow_state”, “Review”);
    }
})

The above code is not working.