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
0
Comments
You should put your code call in CoduUnit 1 - ApplicationManagement in triger/function CompanyOpen Or LogInStart.
In your code you can check sesions with help of system table 2000000009 - Sesion.
bostjan
Thanks!
Alyssa
Create a C/AL global variable recSession, with DataType Record and Subtype Session. When you press the lookup on Subtype, you'll see all virtual tables.
Hello,
I'm interested by this solution but when Navision carries out these functions, the session already exists.
Is it possible to check current sessions before the creation of a new session?
If not, do you request with the user to disconnect itself or is it possible to disconnect it automatically?
Thank you by advance for your answers
Jeff
Hi!
We just do ERROR msg and that it. I didn't look for automatic disconect.
Bostjan
If it was hard to write, it should be hard to understand."
Session.SETRANGE("User ID",USERID);
Session.SETRANGE("My Session",FALSE);
IF Session.FIND('-') THEN
......
Then You can use MESSAGE (Warning) or ERROR (user can not open navision data)
but in any case there session record will be in navision in case that is no possible to delete entries in table Session. (This is possible starting Navision version 4)
@pavithrap0992 : in Navision Attain there is no codeunit 40 (LogInManagement)! Please read thread category.