Hi,
I have written the below code for making some fields read_only after save, but whenever the form get loaded it comes into Not Saved stage, just wanted to check, am I missing something in it?
frappe.ui.form.on("Sales Order", "refresh", function(frm) {
// use the __islocal value of doc, to check if the doc is saved or not
frm.set_df_property("multilane", "read_only", frm.doc.__islocal ? 0 : 1);
}
Regards
Ruchin Sharma
Any error in console?
try it on onload
frappe.ui.form.on("Sales Order", "onload", function(frm) {
frm.set_df_property("multilane", "read_only", frm.doc.__islocal ? 0 : 1);
}
1 Like
@sangram, cannot try it on reload because everytime after save, form need to be reloaded.
And, no error on console as well.
Regards
Ruchin Sharma
?
Have you tried on onload
?
Yes, I did try
But same issue
Working fine for me. Are you updating any field on refresh
event?
Please check your customization.