how to get users name from USERID

Hello! I’m making a report on which i also have to print users name and lastname. To access Navision we use Windows Authentication and sofar i figured out only how to print users Windows Authentication ID (like johnp or georgeb) but not the whole name. I noticed that when i add a new user to access Navision, there is a list of UserIDs and their names. Is there any way to print the whole name (and lastname)? lp john

You can get it like this: User: Record User Name: Text 30 User.GET(USERID); Name := User.Name;

Yes, i tried that however it didn’t help me much because we use Windows Authentication to login to Navision and that represents the biggest problem… Anyone has any ideas how to solve this?? lp john

Hi, You can try the following: windowobject.setrange(ID,LOWERCASE(userid)); windowobject.SETRANGE(Type, ‘user’); windowobject.find(’-’); message(’%1’,windowobject.name); where windowobject is a variable of type Record and Window Objects. Note that userid must be in lowercase. Best Daniel

Maybe I’m missing something, but I suppose you could always use Arthur’s solution, but with the Windows Login table instead of the User table?[?]

When you logon by Windows logon, you can write your username in lower or uppercase … but i don’t think this will argue to .GET function on field of type Code. However you can try to use UPPERCASE(Text) function.

If get it’s not working… why to worry??? tablewheretofilter.SETFILTER(FIELD1,’@’+mystring); IF (Tablewheretofilter.FIND(’-’)) THEN ; @rEGARDS [:D],

Thanks for all the help, but i still haven’t been able to get this working… i can’t use User or Windows Login table because they don’t contain users names :frowning: … Daniel, I don’t have “Window Objects” table so i can’t use your idea :frowning: … I’m slowly giving up on this :slight_smile:

The tables name is Windows Object but you don’t find this table under Object Designer because it’s a temporary table. You can however declared it as a variable (atleast I can do that). Regards Daniel

Daniel, out of curiosity, I just tried to run a report over this “Windows Object” table - it threw an error message that “Active Directory is not enabled”…

  1. Prosen, as Daniel told you, the Windows object table it’s on ALL attain databases, and it’s on the range 2000000000 (zero more, zero less…) like the integer table (that’s not on the list of tables you can usually modify) you can still use it. 2) Heinz, for using that table you’ve to setup MS active directory on your machine, that’s also needed if you’re using windows authentification.