Hey Folks,
I want to update my opportunity sales stage field when sales manager approved quotation from action button.I want to update the field using custom script.Here the problem is i am not able to catching when user click on action approve or reject button.I tried on_submit,workflow_state but both are not working.
Code which i have already tried
//1.
frappe.ui.form.on(“Payment Entry”, {
workflow_state: function(frm) {
if (frm.doc.workflow_state == “Approved”) {
//update opportunity field
}
}
});
//2.
frappe.ui.form.on(“Payment Entry”,“on_submit”, {
function(frm) {
if (frm.doc.workflow_state == “Approved”) {
//update opportunity field
}
}
});
//3.
frappe.ui.form.on(“Payment Entry”, {
on_submit: function(frm) {
if (frm.doc.workflow_state == “Approved”) {
//update opportunity field
}
}
});
//4.
frappe.ui.form.on(“Payment Entry”, {
on_submit: function(frm,cdn,cdt) {
if (frm.doc.workflow_state == “Approved”) {
//update opportunity field
}
}
});
Hi, I also have a problem with workflows. I created a workflow and ticked the checkbox “Don’t Override Status” so that the workflow state show as the status and will not be only on a draft status while the document is in the process of approval.
However, the other status like Overdue, Deliver & Bill, Closed and Paid are not shown if the checkbox “Don’t Override Status” unless you uncheck it but the draft status is shown which leads to confusion.
Another scenario I read is, if these other statuses were not on the workflow, you cannot open the document unless you deactivate the workflow. But I haven’t tested that scenario.