I am trying to use the Active Session table from C/AL Code in NAV 2013.
I am doing the following:
ActiveSession.SETRANGE("Session ID", SESSIONID);
ActiveSession.FINDFIRST;
ServerName :=ActiveSession."Client Computer Name";
However, when that code is executed I get the following error:
"There is no Active Session within the filter. Filters: Session ID: 1"
If I look in SQL at the Active Session table, there aren't any entries. I have restarted the NAV Service multiple times.
Any ideas?
0
Comments
The problem here is that you are forcing your session id filter to 1. Even if there are more that 1 session actually connected they might not be on session id 1. Where do you get this value from ?
So this question remains, because I get this error when calling similar functionality in a SOAP session.
|To-Increase|
As far as I know, the SESSIONID is deprecated and also the virtual table session is gone.
If you want to get the host name of the client you might need to use an automation/.net that runs on the client, like described here: http://www.dynamics.is/?p=282.
http://www.sist.biz/en/ [en] | http://www.sist.biz [de]
I'm working with soap calls. and I require the database name. But regardless that it's always the same name for one instance, I must have it for the current session.
If SessionID is depreciated, I would greatly appreciate if you could point me to documentation about that.
|To-Increase|
But I guess I was wrong, as they are some people using it with 2013.
But I guess there is a simpler way, at least in 2013R2 exists a virtual table Database (ID 2000000048), you can try to filter it for "My Database" = true. And read out the name of the Database.
http://www.sist.biz/en/ [en] | http://www.sist.biz [de]
Looks like I have similar problem. Guys, can I search for any ActiveSession usage with C/SIDE?
I am absolutely unfamiliar with NAV, help please.
If I understood correctly all NAV code is in codeUnits, but I can't understand what invokes them.
OnAfterGetRecord trigger of Company Information page runs following code when System Indicator is "Company + Database" :
The code causes the error.
At Company Information page edit form I've changed System Indicator field value from "Company + Database" to "Company".
Agreed, that's a good solution. I have done this too. In the past if I ever needed the DB name in C/AL, I'd just add it as a new text field to Company Info. Don't know if there's a better solution.
Vincent Connell
so, close the windows client, restart it.
then try again.
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/