Link to the Form is not working

Hello Expert
I want to add TIN and Vendor code to the purchase order. I have edited the supplier doctype to add TIN and Vendor code.

Then I have customised the Purchase order with Link to supplier.

unfortunately the link is not working in PO


It is connecting to the supplier name but not to the TIN. I think I need to change the name in customise to supplier_tin. Correct? How can I do it?

Thanks.

You have to add a custom script to purchase order.

cur_frm.
add_fetch(“link fieldname”, “source fieldname”, “target fieldname”)

Or apparently this other method…

https://frappe.github.io/frappe/user/en/guides/app-development/fetch-custom-field-value-from-master-to-all-related-transactions