How to hide child doc fields?

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)
             };
         })
     };    
});

3 Likes