Running codeunit when starting a new RTC-session

I would like to run a codeunit when a user logs in to NAV. The codeunit has to run during the entire sesion and has to stop at the end of every user session.

In the classic client i can start the codeunit in the CompanyOpen-trigger and then the codeunit keeps running during the whole session. When starting the Role Tailored Client, the codeunit runs, but stops when the rolecenter is opened…

Does anyone has any ideas or suggestions in what codeunit and trigger i best launch this codeunit? Running the codeunit as a NAS is not an option because the company that the user logs on to is a variable in the codeunit running…

Where did you call the Codeunit?

In codeunit 1 “Application management”

There are somany functions in that codeunit…

In CompanyOpen in codeunit1; after the check “IF GUIALLOWED”

The codeunit in fact was running. The problem was that i checked it with a message and messages are not displayed in a RTC-running codeunit…