Filter link based on child table field on other doctype


It is possible to filter link field based on child table field on other doctype.?

doctype 1: purchase order
doctype 2: item

In items table in purchase order , im trying to filter the default item_code based on company.

In Item doctype, i have created a child table that consist of company and warehouse name.

I would like to compare between these two doctype, purchase order and items, if the company in purchase order doctype is in existed in company field in child table at items doctype, it will list the items.

my script but didnt work:

Default Warehouses : child table name in items doctype.

Any input is really appreciated. Thanks

1 Like

Is Default Warehouses a custom child table?

Yes, Default Warehouses is a custom child table.

By default, at item doctype, it only have warehouse field. I create a custom child table is to include warehouse and company.

@naim5441 did you find the solution to problem if so please help me



My code:

Py function:




Hope it helps.


@naim5441 thanks it helped