My usecase :
I have a child table in my doctype, with the field name attachment_details
. I want to hide/unhide based on certain conditions, but the below snipped doesn’t work at all. Is there anything I’m doing wrong?
cur_frm.toggle_display("attachment_details", true);
>> undefined
Have a look at this thread:
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();
…
1 Like
Hi @mr-karan . Also take a look at “depends on” feature of a field.
1 Like
Thanks. I was able to solve it. Here’s the snippet i put in the “Depends On” column
eval:doc.name
(replace name with your actual doctype name)
1 Like