Getting logged in username and password

ombackeombacke Member Posts: 44
Is there a way to get the user name and password of the currently logged in user in Navision code?

Comments

  • DenSterDenSter Member Posts: 8,307
    For the user name use the keyword USERID, and password..... no. It's possible to reset someone's password with sufficient permissions, but you cannot get to the passwords programatically.

    Try this. Create a new form (you don't even have to save it for this example) and put a button on it. In the button's OnPush trigger, write MESSAGE(USERID);. Run the form and click the button. You can also get to the user name. Create a new global record type variable Called MyUser, and write the following code:
    MyUser.GET(USERID);
    MESSAGE(MyUser.Name);
    MESSAGE(MyUser.Password);
    
    When you click the button now, you will see the user's name as entered in the Database Login window, and you will notice that the password shows up in the second message as blank.
  • ombackeombacke Member Posts: 44
    Well thank you... I guess for the password, I'll need to use another way.
  • DenSterDenSter Member Posts: 8,307
    There is no other way. You cannot get to the password. Unless of course, you are a first class hacker, and we'd all be interested in how you did that ;)
  • SavatageSavatage Member Posts: 7,142
    Note: I've never tried this:

    http://www.mibuso.com/dlinfo.asp?FileID=172

    Maybe Luc can shed some light.
  • DenSterDenSter Member Posts: 8,307
    That doesn't work in 4.00 anymore though right?
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    DenSter wrote:
    That doesn't work in 4.00 anymore though right?
    Why should it not work in 4.00? I tested it on MBS-Navision W1 4.0, and it still works.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • DenSterDenSter Member Posts: 8,307
    Well I guess I must stand corrected then :)
Sign In or Register to comment.