How to override auto selected name field from linked child table

My problem is related to frappe-hack-links-using-related-title-instead-of-name.

I wrote a custom query which fetched custom field from a linked data. When I select its name field it sets itself into the input box but when I select other field it sets a null value.

Here 10 mg (Tab) and 5 mg/5 ml (Drop) are the strength field and their name fields are auto generated text something like this (eef731c470).

Thanks in advance

It sounds like what you want is Link Formatters. They’re not super intuitive, to me anyway.