We use the Procedure OnSessionPropertiesSet in the SessionManager.wo.

Code:
Procedure OnSessionPropertiesSet
        Forward Send OnSessionPropertiesSet
        //Switch tenant DB
        ...
        //Clear and find System files
        ...
        //Clear tables that are used with Add_System_Files
        ...