I need a client script that will filter records from a look up table on my new doctype

Hello, I have created a new doctype “Lot Reservation Entry” under a new module “Memorial Park”, there is a child table called “Lot Reservation Item” and under this child table there is a field called “lot_code” which is a link type and is looking up in “Lot Inventory Master”. Parent table “Lot Reservation Entry” has a field “company”, “site_name”, “lot_type_name”. In table “Lot Inventory Master” there is a field “company”, site_name, lot_type. Now, if i add a new record in child table “Lot Reservation Item” it will get the “lot_code” and look up in “Lot Inventory Master” and it will display all the records from “Lot Inventory Master” showing the “lot_code” field. What i want to achieve here is that it should only display records that the company (Lot Reservation Entry) equal to company (Lot Inventory Master), site_name (Lot Reservation Entry) equal to site_name (Lot Inventory Master), lot_type_name (Lot Reservation Entry) equal to lot_type (Lot Inventory Master), status (Lot Inventory Master) equal to “Open”. Can you hep me a client script that will do this? Thanks a lot.

solved already