can a shape know what it is connected to?

I am working on an Organization Chart which connected to a database.
What I am trying to do is have the reports_to field I have to
automatically fill in when a connection is made (instead of having to
do it manually).

For example, I add in a new position, and draw in the line to connect
him with a manager. Is there a way for this shape to know that he is
reporting to this manager? I have a custom property that indicates the
ID for each position. (ie. New position ID500 reports to Manager

Any helps or tips would be appreciated.