Multiple Selection and child filter based on parent

Guys I am trying to make this field like the last image attached in the customer doctype.

What I want is the user should be able to select multiple fields, and based on the field selected they should be given option to choose any child industry (if parent industry has them).

I found out by reading here that there is no multiple select field option, nor are there multiple check box options. So I decided to do it the child doctype way where the child is shown as grid so user can add multiple rows. However, I am unable to configure the child industry match so that only the child of that specific parent is shown and not all the child industries.

This code worked fine on the Item Client Script, I edited this to the best of my knowledge but it wasn’t filtering on my customer script.

cur_frm.set_query("brand", function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
return {
	filters: [
		["manufacturer", "=", d.manufacturer]
	]
}

});

This is what I want to create on customer doctype

Please use gender neutral language on this forum!

Share your actual script.

A simple google search: Can guys be used for girls?

Top Result:
Yes, it is often used in both male and female groups in casual speech. An interesting tidbit about the term “guys” is that it is probably much more often used than either “boys” or “girls” in common speech. Often it is gender-specific, but not always.

Nomenclature in general is often misleading :stuck_out_tongue:
Anyways,
I tried,

cur_frm.set_query("child_industry", function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
return {
	filters: [
		["parent_industry", "=", d.parent_industry]
	]
}

});

I also tried,

filters: [
    		["parent_industry", "=", child_industry.parent_industry]
    	]

but to no avail.

I don’t have the actual script i.e. all that I have tried up till this point or I would have put that code. I deleted it, because it wasn’t working.

Is there Any other method to do what I want or is there any change in script I can do to achieve my goal?