Wednesday, May 21, 2014

AOS Server name from Job

// AOS Server name from Job
static void getServerNameForCurrentSession(Args _args)
 {
   sysClientSessions cliSessions;
   sysServerSessions svrSessions;
   ;
   select svrSessions
     exists join cliSessions
       where cliSessions.SessionId == sessionID()
         && cliSessions.ServerID == svrSessions.ServerId;
   info(substr(svrSessions.AOSId, 1, strfind(svrSessions.AOSId, '@', 1, strlen(svrSessions.AOSId))-1));
 }

No comments:

Post a Comment

Disabling the flight in D365FO (CHD - Tier 1)

 INSERT INTO dbo.SYSFLIGHTING(FLIGHTNAME, ENABLED)  VALUES ('<FlightObjectName>_KillSwitch', 1)  or  INSERT INTO dbo.SYSFLIGHT...