Dear Concern
I want that if suppose UserID(Super) is already login and another user wants to open with the same UserID(Super) then another user can not open with same ID(Super).I have written code in Codeunit1,I showed the error message the error is comming if I press enter key then company opens but I dont want that.Please tell me what code I have to write and where so that another user cannot login with the Same(Super) userID.
Vikram Dabas
Navision Technical Consultant
0
Comments
and also read this
viewtopic.php?f=23&t=24405
In codeunit 1
create variable like this
Name DataType Subtype Length
usersetup Record User Setup
wsh Automation 'Windows Script Host Object Model'.WshShell
sessionrec Record Session
in companyopen() function wite this code
usersetup.RESET;
usersetup.SETFILTER(usersetup."User ID",USERID);
IF usersetup.FINDfirst THEN
BEGIN
sessionrec.RESET;
sessionrec.SETRANGE(sessionrec."User ID",USERID);
IF sessionrec.COUNT > 1 THEN BEGIN
CREATE(wsh);
wsh.SendKeys('%{F4}');
END
end;
now try to login with same user id more than 1...it will close second session
Navision Technical Consultant
100%