Dependent dropdown lookup in child table based on master record

Have 2 tables in master detail relationship. A field in master table, category, lookup to table transact_type for a list of values for selection. In detail table 2 fields, category and role. category also set as lookup to transact_type, while role is dependent on category to filter a list from transact_party for selection. I require that, after selection of value for category, that value will immediately pass to category in detail table. So in detail no need to manually select value for category, and role field will filter out a list of value based on category.

I need custom code that will pass value to detail category from master and that it will re send value whenever it changes in master. I developing my project with PHPRunner.