Hello,
3rd-party application pulls data to the database table, which contains windows login (there are several connections to database, so this app can't decide, what user is needed).
My code has to react to data in updated table, and if it belongs to needed user (currently logged to windows) - open specific form.
I need to find what user is logged in windows now.
NAV provides logged into database in Session table.
Environ('USERNAME') contains completely different stuff ('SYSTEM' on every computer under every user in our case).
e.g. I logged to windows under domain\User1, then used database login User2 to connect to database. Session table will show User2, not domain\User1. USERID will show User2.
Does anybody know how to?
Thanks!
[updated] see solving message
It is hard to swim against self bloodstream... (c) Old, experienced kamikadze.
Answers
1. Let users login to NAV using NT Authentication mode
2. Use WScript object and UserName property http://msdn.microsoft.com/en-us/library/3fxhka75(v=VS.85).aspx There are lot of examples how to use script objects in NAV.
Follow my blog at http://x-dynamics.blogspot.com
some code to put in memory: