Amend Button Changes

Monthly Scheme 22 - 00036-1 when I click amend button why it created new document I want to reset the changed in existing document.

Kindly let me know the the solutions.

Thanks and Regards,
S.Kavitha.

Hi @Kavitha,

There is no option to change exiting the document.

Please read and watch it:
1: Amending Sales Order after Submit
2: Edit Submitted Document
3: ERPNext - Edit Submitted Document (Cancel and Amend) - YouTube

Thank You!

Thanks for your reply @NCP
But Once I clicked Done the document turns into done state but after that I clicked reset button why the document can’t be editable into draft state.

frappe.ui.form.on(‘Monthly Schemes’, {
refresh: function (frm) {
if (frm.doc.workflow_state === “Done”)
frm.add_custom_button(“Reset”, function () {
frm.set_value({“workflow_state”: “Draft”});
cur_frm.save();
})
}

});

Hi @Kavitha,

Why use a custom script for workflow.

ERPNext has an option of Workflows

Reverse flow uses and set status in the workflow.

Thanks.

But when I try in custom script for workflow, I get this error.

Hi @Kavitha,

But you can set the approval stage select before submitting action.

After submitting the action, the document does not set in draft stage.
And using a custom script also does not set submit to draft stage.

Only have an option like set approve stage (set you stage your according.) before submit.

I felt that it was an approved/reset stage to the draft.

Thanks.

Sorry @NCP I can’t Understand what you are trying to convey.

Ok.

I am saying that first you create an approval stage between draft and submit.

In the approval stage, if something is wrong then the reverse stage draft will be set in a workflow.

Please check this example:

Full Details for check topic:
https://docs.erpnext.com/docs/v12/user/manual/en/setting-up/workflows

Thanks.

Hi @NCP ,
Have you said like this.

Thanks,
S.Kavitha

Hi @Kavitha,

Please check and apply it.

Thanks.

The problem is your “Doc Status” (0=Draft, 1=Submitted, 2=Cancelled). Once a document has been submitted, it can’t be changed, and it can’t be “unsubmitted”.

Thanks for your reply @NCP I got the solutions

Thanks for your Replay @peterg