How to Check User is Online or Offline in Ax


In Ax we can Check user is Online or Offline for that we have to Crate Job and Copy below Code to Check. For particular User we have to check this user is online or Offline. We got user information from SysClientSession table. Create Class name it “CheckOnlineUser”. Craete Method inside that Class and Name it “isUserOnline”.

publicbooleanisUserOnline(userIduserId)
{
    ;
return (selectcount(recid) fromSysClientSessionswhereSysClientSessions.userId==UserId&&SysClientSessions.Status==1).RecId;
}

Create Job and Pass Userid for Check User is Online or Offline.

staticvoidCheckOnlineUser(Args _args)
{
CheckOnlineUserCOnline = newCheckOnlineUser();
if(COnline.isUserOnline('Userid') == true)
    {
info("Online");
    }
else
    {
info("Offline");
    }
}

Related Posts

Previous
Next Post »

Thanks for comments.....