Monday, 7 September 2015

hiding fields based on some condition

To hide fields on form

frappe.ui.form.on("Quotation", "onload", function(frm) {
       cur_frm.set_df_property("shipping_rule", "hidden",true);
       msgprint("hi");
});


To hide fields in child table:

frappe.ui.form.on("Quotation", "onload", function(frm) {
       //cur_frm.set_df_property("shipping_rule", "hidden",true);
       cur_frm.fields_dict["items"].grid.set_column_disp('description', false)
       msgprint("hi");
});


TO held fileds in table, you can use eval property of field
eval:doc.item_code == "sample item"
eval:doc.item_code.substr(0,3)== "720"
 

2 comments:

  1. This is the answer to one of my current challenges...I'll try it and come back with my results...:) Thanks!

    ReplyDelete