User Login Problem

vikram7_dabasvikram7_dabas Member Posts: 611
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

Comments

  • garakgarak Member Posts: 3,263
    Do you make it right, it works too!
  • ashbhardwajashbhardwaj Member Posts: 89
    Try this
    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
  • ajoydeyajoydey Member Posts: 21
    Plz paste the code
  • vikram7_dabasvikram7_dabas Member Posts: 611
    Will this code run in NAVSQL
    Vikram Dabas
    Navision Technical Consultant
  • navuser1navuser1 Member Posts: 1,329
    ajoydey wrote:
    Will this code run in NAVSQL

    100% :mrgreen:
    Now or Never
Sign In or Register to comment.