Push field changes into communication database


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

frappe.ui.form.on(“Sales Order”, “validate”, function(frm){
cur_frm.set_value(“workflow_state”,“Pending For Approval”)}
else if(frm.doc.peer_approval==“Reject”){
else if(frm.doc.peer_approval==“Approve”){

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?


This will automatically be captured in 7.3 with built-in versioning

1 Like


Yeah, many thanks! That is great but current client have many customizations so we don’t plan to upgrade to 7.3 for them.

I saw your solution here - Set comment on another document?
but this is to add comment. Will try and see how it goes if suits me fine.

May be this will help

1 Like

Hi @Hafees_Kazhunkil,

Yes the code works! Thanks!