Hi Friends,
My customer do not want any user to login twice to navision with his/her ID.
I decided the write the code in Codeunit 1 - CompanyOpen function. If i test the below code by logging in as 'SA' UserID then the code works and the duplicate session is killed. But the code fails if i login twice with any other user login.
I think since other than 'SA' nobody can see the session records the code is not working. Any suggestion to overcome this?
CREATE(WinShell);
LSession.RESET;
LSession.SETCURRENTKEY("Login Date","Login Time");
LSession.SETRANGE("User ID",USERID);
LSession.SETFILTER("Database Name",'%1','Demo Database NAV (6-0)');
IF LSession.COUNT > 1 THEN BEGIN
IF LSession.FINDLAST THEN
WinShell.SendKeys('%{F4}');
END;
Pls help.
Thanks and Regards
Vineeth.R
0
Comments
Do you get an error when you’re loggin in with login nr2.?
Can’t you just delete the record in the session table instead of using winshell?
Just an idea
ok i will try that.
problem is when normal user other than 'SA' if try to login twice the below cose does not work from his login because he cannot access the session table. So the below written code does not work.
How to make it work?
Thanks
Vineeth
Vineeth.R
http://ssdynamics.co.in