Get the current connection
See GetCurrentConnection Method to find an example on how to get the current connection used in current search page.
The way records are displayed in a SearchPage, and in the associated tree page is defined by a table view.