Unable to get filters runnung

I am using a dev container with erp and custom app. I want to create a risk profiler
I have set 4 Doctypes

  1. Customer Risk Profile

  2. Risk Factors (as child table in customer risk profile)

3, Risk Category DocType

  1. Risk Subcategory

Now when I create the profile , I want subcategories to be filtered based on category selected, but that is not happening

I have added a client scipt

@piyushsawhney add this in the main Doctype refresh

frm.set_query(Fieldname, Child Table Name, function(doc, cdt, cdn) {
			var row = locals[cdt][cdn];
			return {
				filters: {
					"risk_category": row.risk_category,
				}
			}
});

Thanks it worked.