Accessing child doctype field from parent doctype

Hi…I have created a customize app to show all the warehouses ( irespective of user access) and also have a new custom link field called “Actual Target Warehouse“ on stock entry detail doctype.

Now, I want to set this api as set query of my custom field as below:

frappe.ui.form.on(‘Stock Entry’, {
onload(frm) {
console.log(“[DEBUG] onload triggered for Stock Entry:”, frm.doc.name);

    frm.set_query('custom_actual_target_warehouse', function() {
        console.log("[DEBUG] set_query attached and running...");
        return {
            query: "customization.api.warehouse.get_all_warehouses",
        };
    });

    console.log("[DEBUG] custom_actual_target_warehouse query configured.");
},

refresh(frm) {
    console.log("[DEBUG] refresh triggered for:", frm.doc.name);
}

});

problem is that as I am on parent doctype; how can I access child doctype . I need to change the code

frm.set_query(‘custom_actual_target_warehouse’, function() {

but I am not sure how to do it.