Change property based on child field

if child table field item group = tower then i want change property of field present in parent doctype so how will i implement in

    items: function(frm) {
        frm.doc.items.forEach(function(item) {
            if(item.item_group == "Tower"){
                frm.set_df_property('custom_site_picture_post_installation', 'read_only', 1)
                frm.set_df_property('custom_site_picture_pre_installation', 'read_only', 1)
            }
        });
    }
}); ```



I try this way but not working and also tried all child events but not success?

Any solutions for this ?

Hi @Rehan_Ansari

You see and understand this code. I hope You will find a solution.

Thank You!

but not working as per my scenerio

frappe.ui.form.on("Material Request Item", {
    items_add: function(frm, cdt, cdn){
        var child = locals[cdt][cdn];
        if (child.item_group == 'Tower'){
            console.log('running in if')
          cs_center(frm);
        }
    }
})

var cs_center = function(frm){
    frm.set_df_property('custom_site_picture_post_installation', 'hidden', 0)
    frm.set_df_property('custom_site_picture_pre_installation', 'hidden', 0)
}

Hi @Rehan_Ansari1

Please read this post

Thank You!