Hello,
I am new to ERPNext, so please forgive me if my answer is wrong / not exactly what you need.
I would try to edit the carton_no field’s properties like in the picture below:
I named the the parent select field carton_type.
Hello,
I am new to ERPNext, so please forgive me if my answer is wrong / not exactly what you need.
I would try to edit the carton_no field’s properties like in the picture below:
Hello,
Use below method:
cur_frm.fields_dict[child_table].grid.set_column_disp(field_name, condition);
For eg:
cur_frm.fields_dict[“items”].grid.set_column_disp(“custom_qty”, frm.doc.order_type==‘Sales’);
In sales order, if order_type is Sales then custom_qty in child table will display
For more details, kindly check stock_entry.js file erpnext/stock_entry.js at master · frappe/erpnext · GitHub
Thanks, Rohit
Not working
Thank you for your effort
Trying …
You can try :
cur_frm.fields_dict.child_table_field_name.grid.frm.cur_grid.fields_dict.carton_type.$wrapper.hide()
Sorry:
Please try this.
frappe.ui.form.on("Finished Goods Process Child", "finish_goods_process_child_add", function(frm) {
if ('grid' in cur_frm.fields_dict.finish_goods_process_child) {
var grid = cur_frm.fields_dict.finish_goods_process_child.grid;
var interval = setInterval(function () {
if ('cur_grid' in grid.frm) {
if(cur_frm.doc.typ != "Carton"){
grid.frm.cur_grid.fields_dict.carton_no.$wrapper.hide();
}else{
grid.frm.cur_grid.fields_dict.carton_no.$wrapper.show();
}
clearInterval(interval)
};
})
};
});
It works!
Thank you very much Mr Mainul
Is this code supposed to be cahnged/written in a file on the server or put as a custom script? (sorry for the noob question, I’m still learning).
Yes, you need write this code in “doctype_file.js” on DocType Directory.
Thank you!
@Aourongajab_Abir @sorin.negulescu
You can use eval:parent.carton_type==="Carton"
in “Depends On” property of child fields “carton_no”.
Thanks
Thank you
can i hide a specific item?
eval:parent.update_stock===“0”
dear i am using this code to hide rate field depending on update stock but when i write this code in depend on field it completely disappear the rate field in the form but in list view it works fine.
Please help me on this and can anyone let me know to to write same code depending on item code
Hi @mainul
For every row of child table, Is it possible to hide/show a custom field when Item Code uom(Must be Whole Number) is selected.
can you give an Example?
Suppose to be, I have 2-items x and y. For item-x the uom(Must be Whole Number) is checked, so we should show custom_field in child table. For item-y the uom(Must be Whole Number) is unchecked, so we should hide custom_field in child table.
In custom field depend on just use check_fieldname.
if you must be whole number field in Item Doctype, Then fetch this field in child table.