Hi all,
Creating a custom script to prompt user to fill reason of rejection, when the action is rejected but the script is not working.
This is the code i am using:
frappe.ui.form.on('Purchase Order', {
refresh(frm) {
if (frm.doc.workflow_state && frm.doc.workflow_state.indexOf("Rejected") > 0){
frappe.prompt([
{'fieldname': 'rejection_reason', 'fieldtype': 'Small Text', 'label': 'Reason', 'reqd': 1}
],
function(values){
show_alert(values, 5);
},
'Reason for Rejection',
'Submit'
);
}
}
});
Can someone tell me what is wrong?