Options

how to get login name from windows login

vyankuvyanku Member Posts: 791
Hi
By using USERID we get the user name
its fine in database login
but in windows login the login name is domainname\username
In this case by using USERID we got only username not the whole login name( ie.domainname\username)
How can I get whole loginname ?

Answers

  • Options
    aavioaavio Member Posts: 143
    try
    environ('USERDOMAIN') + '\' + USERID
    
    aav!o
  • Options
    AndwianAndwian Member Posts: 627
    Otherwise, you can use Session table.
    Regards,
    Andwian
  • Options
    kinekine Member Posts: 12,562
    Or you can use the Windows Login table, where the full login is used. E.g. look into the lookup form which is used to lookup users in user setup. There is windows login, USERID... and details are in the Login Management codeunit.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    vyankuvyanku Member Posts: 791
    try
    environ('USERDOMAIN') + '\' + USERID
    

    Thanks aavlo.
    You solved my problem \:D/
Sign In or Register to comment.