One DB session per user

Hello, My client would like to implement code to only allow a user to login to Navision once (one current session at a time.) I’ve reviewed posts related to this topic, but they mostly seem to deal with being able to kill an additional session. I want to add code to the login form/table to check the Database information sessions table to see if the user is already logged in. However, I can’t figure out where the source code is for the current sessions or what objec to add the logic to kick off the check when the user logs in. Any help would be appreciated! Thanks! Alyssa

You can lookup in the session table to see if a user is logged in, but You cant automatically log off the current session if there allready is an open session. All You can do is show a message. Maybe it would work if You put the code in the Main Meny in OnopenForm so that the user cant open the Main Menu in the second session. Then that session is useless. /Lars

Why not put the check in the trigger LoginStart in codeunit 1. Then if the user is already logged in once, then call the LoginEnd trigger also in codeunit 1?

But that will also leave the session open, won’t it? I see no way to disconnect from the server in C/AL.

Alyssa, We currently have our users launch Navision via a menu system that we developed. We’ll be using the windows API to determine if a user has a session open and deny them the ability to even execute the .exe before it’s opened. See Windows API function FindWindow()/FindWindowEx(). Hope that helps. Bill