How to get the User name in C/AL?

chinagiantchinagiant Member Posts: 21
Hi!

I want to identify the User in C/AL. I am fine with the windows name or with the login name the user would enter (database login). I tried:
User := USERID;
MESSAGE(Text000, User);

But I only get "< >". How can I find out the current user?

Regards
chinagiant

Comments

  • mrigyamrigya Member Posts: 124
    MESSAGE(USERID);
  • kapamaroukapamarou Member Posts: 1,152
    MESSAGE(Text000, User);

    Does Text000 contain a placeholder, %1 ,for example? If you add to your text string the %1 it will be replaced by User.

    The above command will display the contents of Text000.

    Do it like this:
    Text000 := 'User is: %1';
    MESSAGE(Text000, User);
  • garakgarak Member Posts: 3,263
    User the Global Parameter USERID or if you need the whole windows name read this posts.

    viewtopic.php?t=28010
    viewtopic.php?t=26865

    Regards
    Do you make it right, it works too!
  • chinagiantchinagiant Member Posts: 21
    thanks folks, it did work fine :)
Sign In or Register to comment.