Facing issue in Adding Connection to other Doctypes

I found below thing from where i can simply add the link to other Doctypes

Lets see a scenario
Their is two doctype say Employee and Course
I want to link doctype Employee with course through connection (see below image to understand what i am saying)

now i want to write below logic
when phone_no is same in both doctype (Employee and Course)
then show all courses form which has this phone_no from employee form

can anyone suggest what is wrong ?
i can do for “name” field easily, but can’t do for any other random fields in the doctype

Is this can be done anyhow through coding something ?

If you haven’t checked then please check this.