In my reports I like to see who ran (refreshed) the report. Up until NAV 2009 I could use =NL("First","Session","User ID","My session","TRUE") to retrieve the current user id.
In NAV 2013 however, this function returns a blank value. Does anyone happen to know how I can return the current user with a NAV 2013 datasource? Thanks in advance.
4 comments
-
Jet Reports Historic Posts Hi Hans,
This is probably happening because Jet in NAV 2013 is no longer taking a regular session the way it used to. Since Jet is using web services, I don't think it uses a full blown NAV session like it used to when it was connecting via C/FRONT. Therefore the session table won't give you the current user anymore the way it used to. I'm really not sure how you would get around this. There might be a different table in NAV, although I don't know which one. Since NAV 2013 is always using your Windows user account, I'm sure you could write a VBA macro that gets the current user's Windows username, although that's not an optimal solution.
Regards,
Hughes -
Jet Reports Historic Posts Hi Hans, Hughes,
Is it possible that the information wanted in NAV 2013 is in table "Active Session"?
My next question is then how to get the information of which version of NAV we are connected to?
Anyone an idea?
Thanks!
Bert -
Jet Reports Historic Posts And anyone an idea how to get your own session out of it? (this part of the formula: "My session","TRUE")
-
Jet Reports Historic Posts If you are using SSO (AD-users), you can do this in Excel, without using Jet.
Simply create a module in VBA with:
Function UserName() As String
UserName = Environ("UserName")
End Function
and call the function from a cell:
=username()