Hi,
I have managed to do a “workflow” where an owner is unable to change certain field in custom script.
var test = frappe.user_info().email
cur_frm.set_value(“current_user”,test);
frappe.ui.form.on(“Sales Order”, “validate”, function(frm){
if(cur_frm.doc.owner==test){
cur_frm.set_value(“workflow_state”,“Pending For Approval”)}
else if(frm.doc.peer_approval==“Reject”){
cur_frm.set_value(“workflow_state”,“Rejected”)}
else if(frm.doc.peer_approval==“Approve”){
cur_frm.set_value(“workflow_state”,“Approved”)}
});
The problem using this method is that the document history (which I believe is in communication table) is not captured.
Can anyone guide me on how to push the “workflow state” changes into communication database?
Thanks!