How to Get AOS Server Name of Current Session using X++ in Ax



Description:-

The following code obtains the AOS server name for the current session. Create Job and run.

Code:-

Static void getServerNameForCurrentSession(Args _args) 
{ 
    sysClientSessions cliSessions; 
    sysServerSessions svrSessions; 
    ; 
    select svrSessions
      existsjoin cliSessions
      where cliSessions.SessionId == sessionID() 
            &&cliSessions.ServerID == svrSessions.ServerId; 
    info(substr(svrSessions.AOSId, 1, strfind(svrSessions.AOSId, '@', 1, strlen(svrSessions.AOSId))-1)); 
 }

Or the current AOS server name you're logged onto:

static void CurAOSServerName(Args _args)
{
    xSession xSession;
    ;
    xSession = new xSession();
    info(strfmt('Current AOS server name-%1',xSession.AOSName()));
}

Related Posts

Thanks for comments.....

:)
:(
hihi
:-)
:D
=D
:-d
;(
;-(
@-)
:P
:o
:>)
(o)
:p
:-?
(p)
:-s
(m)
8-)
:-t
:-b
b-(
:-#
=p~
$-)
(y)
(f)
x-)
(k)
(h)
cheer